MCPcopy Index your code
hub / github.com/webpy/webpy / where

Method where

web/db.py:872–904  ·  view source on GitHub ↗

Selects from `table` where keys are equal to values in `kwargs`. >>> db = DB(None, {}) >>> db.where('foo', bar_id=3, _test=True) >>> db.where('foo', source=2, crust='dewey', _test=True)

(
        self,
        table,
        what="*",
        order=None,
        group=None,
        limit=None,
        offset=None,
        _test=False,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

870 return self.query(qout, processed=True)
871
872 def where(
873 self,
874 table,
875 what="*",
876 order=None,
877 group=None,
878 limit=None,
879 offset=None,
880 _test=False,
881 **kwargs,
882 ):
883 """
884 Selects from `table` where keys are equal to values in `kwargs`.
885
886 >>> db = DB(None, {})
887 >>> db.where('foo', bar_id=3, _test=True)
888 <sql: 'SELECT * FROM foo WHERE bar_id = 3'>
889 >>> db.where('foo', source=2, crust='dewey', _test=True)
890 <sql: "SELECT * FROM foo WHERE crust = 'dewey' AND source = 2">
891 >>> db.where('foo', _test=True)
892 <sql: 'SELECT * FROM foo'>
893 """
894 where = self._where_dict(kwargs)
895 return self.select(
896 table,
897 what=what,
898 order=order,
899 group=group,
900 limit=limit,
901 offset=offset,
902 _test=_test,
903 where=where,
904 )
905
906 def sql_clauses(self, what, tables, where, group, order, limit, offset):
907 return (

Callers 1

test_whereMethod · 0.80

Calls 2

_where_dictMethod · 0.95
selectMethod · 0.95

Tested by 1

test_whereMethod · 0.64