From: Federico Caselli Date: Tue, 12 Mar 2024 22:05:50 +0000 (+0100) Subject: improve docs for sqlite memory db X-Git-Tag: rel_2_0_29~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=507f4aa1fc5ff10caa08bce4cb71e741ce40036e;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git improve docs for sqlite memory db Change-Id: Icdbc13bdad3fb5ae69e79605bb7e6cb82d538c80 References: #10968 (cherry picked from commit e560794883c5a3259aa4208ee7c5aa0740cb3087) --- diff --git a/lib/sqlalchemy/dialects/sqlite/pysqlite.py b/lib/sqlalchemy/dialects/sqlite/pysqlite.py index e248779007..f39baf3217 100644 --- a/lib/sqlalchemy/dialects/sqlite/pysqlite.py +++ b/lib/sqlalchemy/dialects/sqlite/pysqlite.py @@ -51,11 +51,14 @@ used. Double backslashes are probably needed:: # absolute path on Windows e = create_engine('sqlite:///C:\\path\\to\\database.db') -The sqlite ``:memory:`` identifier is the default if no filepath is -present. Specify ``sqlite://`` and nothing else:: +To use sqlite ``:memory:`` database specify it as the filename using +``sqlite://:memory:``. It's also the default if no filepath is +present, specifying only ``sqlite://`` and nothing else:: # in-memory database - e = create_engine('sqlite://') + e = create_engine('sqlite://:memory:') + # also in-memory database + e2 = create_engine('sqlite://') .. _pysqlite_uri_connections: diff --git a/lib/sqlalchemy/ext/automap.py b/lib/sqlalchemy/ext/automap.py index 76986077c8..bf6a5f2690 100644 --- a/lib/sqlalchemy/ext/automap.py +++ b/lib/sqlalchemy/ext/automap.py @@ -1006,7 +1006,7 @@ class AutomapBase: :class:`.util.Properties`, such as ``items()``, the getitem form is also supported:: - Item = Base.classes["item"] + Item = Base.classes["items"] """