(collection_key, serp_urls)
| 32 | print("Connection closed.") |
| 33 | |
| 34 | def create_record(collection_key, serp_urls): |
| 35 | connection, cursor = create_connection() |
| 36 | if connection and cursor: |
| 37 | try: |
| 38 | insert_query = """ |
| 39 | INSERT INTO embeddings (collection_key, serp_urls) |
| 40 | VALUES (%s, %s); |
| 41 | """ |
| 42 | cursor.execute(insert_query, (collection_key, serp_urls)) |
| 43 | connection.commit() |
| 44 | print("Record created successfully.") |
| 45 | except psycopg2.Error as error: |
| 46 | print("Error with database operation:", error) |
| 47 | finally: |
| 48 | close_connection(connection) |
| 49 | |
| 50 | def update_record(collection_key, new_serp_urls): |
| 51 | connection, cursor = create_connection() |
no test coverage detected