33
44.. module :: sqlite3
55 :synopsis: A DB-API 2.0 implementation using SQLite 3.x.
6- ..
sectionauthor ::
Gerhard Häring <[email protected] > 6+ ..
sectionauthor ::
Gerhard Häring <[email protected] > 77
88
99SQLite is a C library that provides a lightweight disk-based database that
@@ -20,6 +20,7 @@ To use the module, you must first create a :class:`Connection` object that
2020represents the database. Here the data will be stored in the
2121:file: `/tmp/example ` file::
2222
23+ import sqlite3
2324 conn = sqlite3.connect('/tmp/example')
2425
2526You can also supply the special name ``:memory: `` to create a database in RAM.
@@ -56,15 +57,15 @@ example::
5657
5758 # Never do this -- insecure!
5859 symbol = 'IBM'
59- c.execute("... where symbol = '%s'" % symbol)
60+ c.execute("select * from stocks where symbol = '%s'" % symbol)
6061
6162 # Do this instead
6263 t = (symbol,)
6364 c.execute('select * from stocks where symbol=?', t)
6465
6566 # Larger example
6667 for t in [('2006-03-28', 'BUY', 'IBM', 1000, 45.00),
67- ('2006-04-05', 'BUY', 'MSOFT ', 1000, 72.00),
68+ ('2006-04-05', 'BUY', 'MSFT ', 1000, 72.00),
6869 ('2006-04-06', 'SELL', 'IBM', 500, 53.00),
6970 ]:
7071 c.execute('insert into stocks values (?,?,?,?,?)', t)
@@ -271,7 +272,6 @@ Connection Objects
271272 calling the cursor method, then calls the cursor's :meth: `executemany
272273 <Cursor.executemany> ` method with the parameters given.
273274
274-
275275.. method :: Connection.executescript(sql_script)
276276
277277 This is a nonstandard shortcut that creates an intermediate cursor object by
@@ -376,22 +376,22 @@ Connection Objects
376376 aggregates or whole new virtual table implementations. One well-known
377377 extension is the fulltext-search extension distributed with SQLite.
378378
379+ Loadable extensions are disabled by default. See [#f1 ]_.
380+
379381 .. versionadded :: 3.2
380382
381383 .. literalinclude :: ../includes/sqlite3/load_extension.py
382384
383- Loadable extensions are disabled by default. See [#f1 ]_.
384-
385385.. method :: Connection.load_extension(path)
386386
387387 This routine loads a SQLite extension from a shared library. You have to
388388 enable extension loading with :meth: `enable_load_extension ` before you can
389389 use this routine.
390390
391- .. versionadded :: 3.2
392-
393391 Loadable extensions are disabled by default. See [#f1 ]_.
394392
393+ .. versionadded :: 3.2
394+
395395.. attribute :: Connection.row_factory
396396
397397 You can change this attribute to a callable that accepts the cursor and the
0 commit comments