MCPcopy Index your code
hub / github.com/tortoise/tortoise-orm / get_sql

Method get_sql

tortoise/fields/db_defaults.py:59–62  ·  view source on GitHub ↗
(self, _context=None, dialect: str | None = None)

Source from the content-addressed store, hash-verified

57 super().__init__("CURRENT_TIMESTAMP")
58
59 def get_sql(self, _context=None, dialect: str | None = None) -> str:
60 if dialect and dialect in self._DIALECT_SQL:
61 return self._DIALECT_SQL[dialect]
62 return self.sql
63
64 def __repr__(self) -> str:
65 return "Now()"

Callers 6

test_now_constructionFunction · 0.95
test_now_dialect_mysqlFunction · 0.95
test_now_dialect_otherFunction · 0.95
get_update_sqlMethod · 0.45
_get_field_defaultMethod · 0.45

Calls

no outgoing calls

Tested by 3

test_now_constructionFunction · 0.76
test_now_dialect_mysqlFunction · 0.76
test_now_dialect_otherFunction · 0.76