MCPcopy Create free account
hub / github.com/dbcli/mycli / now

Method now

mycli/sqlexecute.py:541–549  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

539 yield from cur
540
541 def now(self) -> datetime.datetime:
542 assert isinstance(self.conn, Connection)
543 with self.conn.cursor() as cur:
544 _logger.debug("Now Query. sql: %r", self.now_query)
545 cur.execute(self.now_query)
546 if one := cur.fetchone():
547 return one[0]
548 else:
549 return datetime.datetime.now()
550
551 def get_connection_id(self) -> int | None:
552 if not self.connection_id:

Callers 5

log_queryMethod · 0.45
server_dateFunction · 0.45
server_datetimeFunction · 0.45
get_local_timezoneFunction · 0.45
render_prompt_stringFunction · 0.45

Calls 4

cursorMethod · 0.45
debugMethod · 0.45
executeMethod · 0.45
fetchoneMethod · 0.45

Tested by

no test coverage detected