Wykres commitów

6 Commity (83598cdb3c7fd92928d2ac953141fc0f70793e05)

Autor SHA1 Wiadomość Data
Robert Klink 83598cdb3c unix-ffi/sqlite3: Change to use close and prepare v2 versions, clean-up.
The sqlite3_prepare and sqlite3_close have been changed to use the v2
version. For the prepare this was done as the v1 version is "legacy",
and for close the documentation describes the v2 version to be used for
"host languages that are garbage collected, and where the order in
which destructors are called is arbitrary", which fits here.

Some clean-up to comments has also be done, and the tests now also
close the Cursor and Connections.

Signed-off-by: Robert Klink <rhermanklink@ripe.net>
2024-08-22 13:09:33 +10:00
Robert Klink ab9c5a01b0 unix-ffi/sqlite3: Add optional parameter for URI support.
This commit adds the ability to enable URI on the connect, as can be done
in the cpython sqlite3 module. URI allows, among other things, to create
a shared named in-memory database, which non URI filenames cannot create.

Signed-off-by: Robert Klink <rhermanklink@ripe.net>
2024-08-22 13:09:33 +10:00
Robert Klink 0a65c3d34a unix-ffi/sqlite3: Fix statements not being finalized.
Currently, statements are only finalized upon a call to Cursor.close().
However, in Cursor.execute() new statements get created without the
previous statements being finalized, causing those to get leaked,
preventing the database from being closed. The fix addresses this by
finalizing the previous statement if it exists.

Signed-off-by: Robert Klink <rhermanklink@ripe.net>
2024-08-22 13:09:33 +10:00
Robert Klink 8d6ebf57a2 unix-ffi/sqlite3: Fix bytes to accommodate for different pointer sizes.
Currently, the bytes object used to store the sqlite3 database pointer
is always 4 bytes, which causes segfaults on 64 bit platforms with 8
byte pointers. To address this, the size is now dynamically determined
using the uctypes modules pointer size.

Signed-off-by: Robert Klink <rhermanklink@ripe.net>
2024-08-22 13:09:33 +10:00
Jim Mussared fa13cbbc8b all: Run black over all code.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-05-27 15:50:04 +10:00
Jim Mussared 1a28fe84e8 top: Move modules into python-stdlib, unix-ffi, or micropython. 2021-05-27 15:41:08 +10:00