@@ -8,25 +8,83 @@ meta: SQLite is an relational database built into the Python standard library th
88
99
1010# SQLite
11- SQLite is an open source relational database included with the Python standard
12- library as of Python 2.5. The pysqlite database driver is also included with
13- the standard library so that no further external dependencies are required to
14- access a SQLite database from within Python applications.
11+ SQLite is an open source [ relational database] ( /databases.html ) included with
12+ the Python standard library as of Python 2.5. The pysqlite database driver
13+ is also included with the standard library so that no further external
14+ dependencies are required to access a SQLite database from within Python
15+ applications.
1516
16- <img src =" /img/logos/sqlite.jpg " width =" 100% " alt =" SQLite logo. " class = " technical-diagram " / >
17+ <img src =" /img/logos/sqlite.jpg " width =" 100% " alt =" SQLite logo. " >
1718
1819<div class =" well see-also " >SQLite is an implementation of the <a href =" /databases.html " >relational database</a > concept. Learn more in the <a href =" /data.html " >data</a > chapter or view the <a href =" /table-of-contents.html " >table of contents</a > for all topics.</div >
1920
2021
21- ### SQLite resources
22- * [ sqlite3 - embedded relational database] ( https://pymotw.com/2/sqlite3/ ) is an
23- extensive tutorial showing many of the common create, read, update and delete
24- operations a developer would want to do with SQLite.
22+ ### Useful SQLite tools and code
23+ SQLite is used in such a wide variety of industries that there are open
24+ source tools and example code for all kinds of edge case uses. Here are
25+ several tools and bits of code I have found useful while coding my
26+ applications:
27+
28+ * [ sqlitebiter] ( http://sqlitebiter.readthedocs.io/en/latest/ )
29+ ([ source code] ( https://github.com/thombashi/sqlitebiter ) ) is a command-line
30+ tool for converting various data formats such as comma-separated
31+ values (CSV), HTML, Markdown and JSON (among others) into a SQLite database
32+ file.
33+
34+ * [ Scout] ( http://scout.readthedocs.io/en/latest/ )
35+ ([ source code] ( https://github.com/coleifer/scout ) )
36+ is a [ Flask] ( /flask.html ) -powered search server for SQLite backends. The
37+ [ introductory post] ( http://charlesleifer.com/blog/meet-scout-a-search-server-powered-by-sqlite/ )
38+ is really handy for getting started with Scout.
39+
40+ * [ Datasette] ( https://github.com/simonw/datasette ) makes it easy to expose
41+ JSON [ APIs] ( /application-programming-interfaces.html ) from your SQLite
42+ database without coding up a custom web application. Make sure to
43+ check out the
44+ [ Datasette getting started guide] ( https://simonwillison.net/2017/Nov/13/datasette/ )
45+ as well.
46+
47+ * [ SQLite Browser] ( http://sqlitebrowser.org/ ) is an open source graphical user
48+ interface for working with SQLite.
49+
50+ * The
51+ [ Membership SQLite SQL scripts] ( https://github.com/membership/membership.db/tree/master/sqlite )
52+ provide example code for storing user accounts, roles and authentication
53+ tokens in web applications.
54+
55+
56+ ### SQLite tutorials
57+ It's a good idea to brush up on the basics for using SQLite before you use
58+ the database in your project through SQL scripts or via an
59+ [ object-relational mapper] ( /object-relational-mappers-orms.html ) . These
60+ tutorials will help you get started.
2561
2662* [ A simple step-by-step SQLite tutorial] ( http://www.blog.pythonlibrary.org/2012/07/18/python-a-simple-step-by-step-sqlite-tutorial/ )
2763 walks through creating databases as well as inserting, updating, querying and
2864 deleting data.
2965
66+ * [ A Minimalist Guide to SQLite] ( http://tech.marksblogg.com/sqlite3-tutorial-and-guide.html )
67+ shows how to install SQLite, load data and work with the data stored in
68+ a new SQLite database.
69+
70+ * [ sqlite3 - embedded relational database] ( https://pymotw.com/3/sqlite3/ ) is an
71+ extensive tutorial showing many of the common create, read, update and delete
72+ operations a developer would want to do with SQLite.
73+
74+ * The official
75+ [ sqlite3 module in the Python stdlib docs] ( https://docs.python.org/3/library/sqlite3.html )
76+ contains a bunch of scenarios with code for how to use the database from
77+ a Python application.
78+
79+ * [ Finding bugs in SQLite, the easy way] ( http://lcamtuf.blogspot.com/2015/04/finding-bugs-in-sqlite-easy-way.html )
80+ explains how a bug was found - and quickly fixed - in the SQLite codebase.
81+ It's a great short read which shows that the code is well-tested and
82+ maintained.
83+
84+ * [ Data Analysis of 8.2 Million Rows with Python and SQLite] ( https://plot.ly/ipython-notebooks/big-data-analytics-with-pandas-and-sqlite/ )
85+ explains how you can load a large dataset in to SQLite and visualize it
86+ using the Plotly service.
87+
3088* [ SQLite: The art of keep it simple] ( http://www.jarchitect.com/Blog/?p=2392 )
3189 uses C code examples from SQLite's codebase to show how its design has been
3290 kept consistent and tight throughout 15+ years of active development.
@@ -38,21 +96,24 @@ access a SQLite database from within Python applications.
3896 is a nice roundup of useful tools to use with SQLite and tutorials for
3997 learning more about the database.
4098
41- * [ Extending SQLite with Python] ( http://charlesleifer.com/blog/extending-sqlite-with-python/ )
42- uses the Peewee
43- [ object-relational mapper (ORM)] ( /object-relational-mappers-orms.html )
44- to implement virtual tables and aggregates on top of SQLite.
4599
46- * [ Using SQLite with Flask] ( http://flask.pocoo.org/docs/0.10/patterns/sqlite3/ )
47- explains how Flask code can directly query a SQLite database without an ORM.
48100
49- * [ SQLite Browser] ( http://sqlitebrowser.org/ ) is an open source graphical user
50- interface for working with SQLite.
101+ ### Specific SQLite scenarios
102+ These are solid resources if you are looking to solve a particular problem
103+ you are having with SQLite rather than going through a general tutorial.
51104
52- * The official
53- [ sqlite3 module in the Python stdlib docs] ( https://docs.python.org/3/library/sqlite3.html )
54- contains a bunch of scenarios with code for how to use the database from
55- a Python application.
105+ * [ Let's Build a Simple Database] ( https://cstack.github.io/db_tutorial/ )
106+ is an * awesome* read where the author re-creates a SQLite-type database
107+ for learning purposes.
108+
109+ * [ We are pretty happy with SQLite & not urgently interested in a fancier DBMS] ( http://beets.io/blog/sqlite-performance.html )
110+ gives the rationale behind one development teams' decision to stick to
111+ SQLite instead of porting to another relational database such as
112+ [ MySQL] ( /mysql.html ) or [ PostgreSQL] ( /postgresql.html ) .
113+
114+ * [ How SQLite is tested] ( https://www.sqlite.org/testing.html ) digs into the
115+ nitty-gritty behind the quality assurance practices for testing potential
116+ SQLite releases.
56117
57118* [ Using the SQLite JSON1 and FTS5 Extensions with Python] ( http://charlesleifer.com/blog/using-the-sqlite-json1-and-fts5-extensions-with-python/ )
58119 shows how to compile SQLite 3.9.0+ with json1 and fts5 (full-text search)
@@ -61,3 +122,21 @@ access a SQLite database from within Python applications.
61122* [ SQLite with a fine-toothed comb] ( http://blog.regehr.org/archives/1292 )
62123 digs into the internals of SQLite and shows some bugs found (and
63124 since fixed) while the author was researching the SQLite source code.
125+
126+ * [ Going Fast with SQLite and Python] ( http://charlesleifer.com/blog/going-fast-with-sqlite-and-python/ )
127+ shares essential knowledge for working effectively with SQLite in Python,
128+ particularly when it comes to transactions, concurrency and commits.
129+
130+ * [ Extending SQLite with Python] ( http://charlesleifer.com/blog/extending-sqlite-with-python/ )
131+ uses the [ Peewee] ( /peewee.html )
132+ [ object-relational mapper (ORM)] ( /object-relational-mappers-orms.html )
133+ to implement virtual tables and aggregates on top of SQLite.
134+
135+ * [ Using SQLite with Flask] ( http://flask.pocoo.org/docs/0.10/patterns/sqlite3/ )
136+ explains how Flask code can directly query a SQLite database without an ORM.
137+
138+ * [ Use SQLite with Django On AWS Lambda with Zappa] ( https://blog.zappa.io/posts/use-sqlite-with-django-on-aws-lambda-with-zappa )
139+ provides an example ` dev_settings.py ` file for
140+ locally testing a [ Django] ( /django.html ) application intended for
141+ [ AWS Lambda] ( /aws-lambda.html ) .
142+
0 commit comments