• 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()
136 self.con.row_factory = sqlite.Row
137 row = self.con.execute("select 1 as a, 2 as b").fetchone()
143 self.con.row_factory = sqlite.Row
144 row = self.con.execute("select 1 as a, 2 as b").fetchone()
150 self.con.row_factory = sqlite.Row
151 row = self.con.execute("select 1 as a, 2 as b").fetchone()
158 self.con.row_factory = sqlite.Row
159 row_1 = self.con.execute("select 1 as a, 2 as b").fetchone()
160 row_2 = self.con.execute("select 1 as a, 2 as b").fetchone()
161 row_3 = self.con.execute("select 1 as a, 3 as b").fetchone()
178 self.con.row_factory = sqlite.Row
179 row = self.con.execute("select 1 as a, 2 as b").fetchone()
191 self.con.row_factory = sqlite.Row
192 self.assertRaises(TypeError, self.con.cursor, FakeCursor)
196 self.con.close()
200 self.con = sqlite.connect(":memory:")
204 row = self.con.execute("select ?", (austria,)).fetchone()
208 self.con.text_factory = str
210 row = self.con.execute("select ?", (austria,)).fetchone()
215 self.con.text_factory = lambda x: unicode(x, "utf-8", "ignore")
217 row = self.con.execute("select ?", (austria.encode("latin1"),)).fetchone()
222 self.con.text_factory = sqlite.OptimizedUnicode
225 a_row = self.con.execute("select ?", (austria,)).fetchone()
226 d_row = self.con.execute("select ?", (germany,)).fetchone()
231 self.con.close()
235 self.con = sqlite.connect(":memory:")
236 self.con.execute("create table test (value text)")
237 self.con.execute("insert into test (value) values (?)", ("a\x00b",))
241 row = self.con.execute("select value from test").fetchone()
247 self.con.text_factory = lambda x: x
248 row = self.con.execute("select value from test").fetchone()
254 self.con.text_factory = sqlite.OptimizedUnicode
255 row = self.con.execute("select value from test").fetchone()
261 self.con.text_factory = sqlite.OptimizedUnicode
262 self.con.execute("delete from test")
263 self.con.execute("insert into test (value) values (?)", (u'�\0�',))
264 row = self.con.execute("select value from test").fetchone()
269 self.con.close()