MCPcopy Create free account
hub / github.com/caesarHQ/textSQL / create_session

Function create_session

api/app/api/utils/caesar_logging.py:228–248  ·  view source on GitHub ↗
(app_name, user_id)

Source from the content-addressed store, hash-verified

226
227@failsoft
228def create_session(app_name, user_id):
229 if not EVENTS_ENGINE:
230 return None
231
232 parms = {
233 "app_name": app_name,
234 "user_id": user_id,
235 }
236 create_query = text("""
237 INSERT INTO sessions (app_name, user_id)
238 VALUES (:app_name, :user_id)
239 returning id
240 """)
241 with EVENTS_ENGINE.connect() as conn:
242 # get the ID back
243 result = conn.execute(create_query, parms)
244 conn.commit()
245 row = result.fetchone()
246 session_id = row[0]
247
248 return str(session_id)
249
250@failsoft
251def get_feed_data(app):

Callers 1

get_session_idFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected