MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / false

Function false

lib/sqlalchemy/sql/_elements_constructors.py:1288–1325  ·  view source on GitHub ↗

Return a :class:`.False_` construct. E.g.: .. sourcecode:: pycon+sql >>> from sqlalchemy import false >>> print(select(t.c.x).where(false())) {printsql}SELECT x FROM t WHERE false A backend which does not support true/false constants will render as an expr

()

Source from the content-addressed store, hash-verified

1286
1287
1288def false() -> False_:
1289 """Return a :class:`.False_` construct.
1290
1291 E.g.:
1292
1293 .. sourcecode:: pycon+sql
1294
1295 >>> from sqlalchemy import false
1296 >>> print(select(t.c.x).where(false()))
1297 {printsql}SELECT x FROM t WHERE false
1298
1299 A backend which does not support true/false constants will render as
1300 an expression against 1 or 0:
1301
1302 .. sourcecode:: pycon+sql
1303
1304 >>> print(select(t.c.x).where(false()))
1305 {printsql}SELECT x FROM t WHERE 0 = 1
1306
1307 The :func:`.true` and :func:`.false` constants also feature
1308 "short circuit" operation within an :func:`.and_` or :func:`.or_`
1309 conjunction:
1310
1311 .. sourcecode:: pycon+sql
1312
1313 >>> print(select(t.c.x).where(or_(t.c.x > 5, true())))
1314 {printsql}SELECT x FROM t WHERE true{stop}
1315
1316 >>> print(select(t.c.x).where(and_(t.c.x > 5, false())))
1317 {printsql}SELECT x FROM t WHERE false{stop}
1318
1319 .. seealso::
1320
1321 :func:`.true`
1322
1323 """
1324
1325 return False_._instance()
1326
1327
1328def funcfilter(

Callers 15

test_sixMethod · 0.90
test_seven_bMethod · 0.90
test_seven_dMethod · 0.90
test_eightMethod · 0.90
test_nineMethod · 0.90
test_single_bool_fourMethod · 0.90
test_single_bool_sixMethod · 0.90
test_eightMethod · 0.90
test_nineMethod · 0.90

Calls 1

_instanceMethod · 0.45

Tested by 15

test_sixMethod · 0.72
test_seven_bMethod · 0.72
test_seven_dMethod · 0.72
test_eightMethod · 0.72
test_nineMethod · 0.72
test_single_bool_fourMethod · 0.72
test_single_bool_sixMethod · 0.72
test_eightMethod · 0.72
test_nineMethod · 0.72