-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_chris.py
More file actions
35 lines (32 loc) · 1007 Bytes
/
Copy pathcheck_chris.py
File metadata and controls
35 lines (32 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""
Quick script to check if any prospects contain 'chris' in name, email, or company.
"""
def check_chris():
from app.utils.db import get_db_connection
def check_chris():
conn_gen = get_db_connection()
conn = next(conn_gen)
cur = conn.cursor()
try:
cur.execute("""
SELECT id, first_name, last_name, email, company_name FROM prospects
WHERE (
LOWER(first_name) LIKE '%chris%'
OR LOWER(last_name) LIKE '%chris%'
OR LOWER(email) LIKE '%chris%'
OR LOWER(company_name) LIKE '%chris%'
)
AND hide IS NOT TRUE
LIMIT 10;
""")
rows = cur.fetchall()
if rows:
for row in rows:
print(row)
else:
print("No prospects found with 'chris' in first_name, last_name, email, or company_name.")
except Exception as e:
print(f"Error: {e}")
finally:
cur.close()
conn.close()