MCPcopy Index your code
hub / github.com/BlueBash/BlogIQ / create_record

Function create_record

postgres.py:34–48  ·  view source on GitHub ↗
(collection_key, serp_urls)

Source from the content-addressed store, hash-verified

32 print("Connection closed.")
33
34def 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
50def update_record(collection_key, new_serp_urls):
51 connection, cursor = create_connection()

Callers 1

create_collectionFunction · 0.90

Calls 2

create_connectionFunction · 0.85
close_connectionFunction · 0.85

Tested by

no test coverage detected