• Home
  • Raw
  • Download

Lines Matching refs:con

45         self.con = sqlite.connect(":memory:", factory=MyConnection)
48 self.con.close()
51 self.assertIsInstance(self.con, MyConnection)
55 self.con = sqlite.connect(":memory:")
58 self.con.close()
61 cur = self.con.cursor()
63 cur = self.con.cursor(MyCursor)
65 cur = self.con.cursor(factory=lambda con: MyCursor(con))
70 self.assertRaises(TypeError, self.con.cursor, None)
72 self.assertRaises(TypeError, self.con.cursor, lambda: None)
74 self.assertRaises(TypeError, self.con.cursor, lambda con: None)
78 self.con = sqlite.connect(":memory:")
81 cur = self.con.cursor(factory=MyCursor)
88 self.con.close()
92 self.con = sqlite.connect(":memory:")
95 self.con.row_factory = lambda cur, row: list(row)
96 row = self.con.execute("select 1, 2").fetchone()
100 self.con.row_factory = sqlite.Row
101 row = self.con.execute("select 1 as a, 2 as b").fetchone()
128 self.con.row_factory = sqlite.Row
129 row = self.con.execute("select 1, 2, 3, 4").fetchone()
146 self.con.row_factory = sqlite.Row
147 row = self.con.execute("select 1 as a, 2 as b").fetchone()
153 self.con.row_factory = sqlite.Row
154 row = self.con.execute("select 1 as a, 2 as b").fetchone()
160 self.con.row_factory = sqlite.Row
161 row = self.con.execute("select 1 as a, 2 as b").fetchone()
168 self.con.row_factory = sqlite.Row
169 row_1 = self.con.execute("select 1 as a, 2 as b").fetchone()
170 row_2 = self.con.execute("select 1 as a, 2 as b").fetchone()
171 row_3 = self.con.execute("select 1 as a, 3 as b").fetchone()
188 self.con.row_factory = sqlite.Row
189 row = self.con.execute("select 1 as a, 2 as b").fetchone()
201 self.con.row_factory = sqlite.Row
202 self.assertRaises(TypeError, self.con.cursor, FakeCursor)
206 self.con.close()
210 self.con = sqlite.connect(":memory:")
214 row = self.con.execute("select ?", (austria,)).fetchone()
218 self.con.text_factory = bytes
220 row = self.con.execute("select ?", (austria,)).fetchone()
225 self.con.text_factory = lambda x: str(x, "utf-8", "ignore")
227 row = self.con.execute("select ?", (austria,)).fetchone()
234 self.con.text_factory = sqlite.OptimizedUnicode
237 a_row = self.con.execute("select ?", (austria,)).fetchone()
238 d_row = self.con.execute("select ?", (germany,)).fetchone()
243 self.con.close()
247 self.con = sqlite.connect(":memory:")
248 self.con.execute("create table test (value text)")
249 self.con.execute("insert into test (value) values (?)", ("a\x00b",))
253 row = self.con.execute("select value from test").fetchone()
258 self.con.text_factory = bytes
259 row = self.con.execute("select value from test").fetchone()
264 self.con.text_factory = bytearray
265 row = self.con.execute("select value from test").fetchone()
271 self.con.text_factory = lambda x: x
272 row = self.con.execute("select value from test").fetchone()
277 self.con.close()