Commit Graph

20 Commits

Author SHA1 Message Date
Vadim Zeitlin 93ddffb05f Add functions returning native error description to soci_error
Allow handling backend-specific errors without including
backend-specific headers.
2025-04-23 01:33:23 +02:00
Vadim Zeitlin 62001b2365 Add sqlite3_soci_error::extended_result()
Allow to get the extended error code from SQLite too.

Add a unit test checking that the new function returns the expected
result.
2025-04-22 16:48:44 +02:00
Vadim Zeitlin 51a5715164 Simplify and centralize SQLite3 backend error generation
Call sqlite3_errmsg() directly in sqlite3_soci_error ctor instead of
doing it in multiple places in the backend code.

Throw soci_error when there is no SQLite3-specific information
associated with the error.

Update the documentation to make it more clear that both
sqlite3_soci_error and soci_error must be caught.
2025-04-22 16:14:12 +02:00
Vadim Zeitlin 0fd87b66e6 Build SQLite3 ourselves if it's not otherwise available
Use sources from the submodule to create soci_sqlite3_builtin library.
Recommend cloning with --recurse-submodule to ensure that the submodule
is available and update AppVeyor CI to initialize submodules too.

Add "BUILTIN" dependency mode to soci_define_backend_target() and use it
for SQLite3 backend.

Note that because SQLite3 source is C, and not C++, this language needs
to be explicitly added to CMake project() function, otherwise C files
are just silently ignored.

This commit is best viewed ignoring whitespace-only changes.
2025-04-11 01:53:56 +02:00
Vadim Zeitlin 3bc032dec4 Add sqlite3_session_backend::libversion() and libversion_number()
Use these functions instead of directly using SQLite3 ones in the test.

This makes no real difference, but allows to provide the implementation
of these functions in SOCI SQLite3 backend itself and so works even when
SQLite3 library is linked statically into this backend and is not linked
into the test.
2025-04-11 01:52:33 +02:00
Robert Adam 77c75a4e85 Make SQLite overwrite exchange type for integers
Since SQLite doesn't have a type system, we have to always be prepared
to select huge numbers, even if the "type" is e.g. int8.
To do that, we overwrite the exchange type (e.g. in row based APIs) to
always be (u)int64 for integers to avoid over-/underflows.

Update the documentation to explain this SQLite peculiarity and add a
test verifying that this behaves as expected.

Fixes #1190.

Closes #1217.
2025-03-24 00:14:00 +01:00
Vadim Zeitlin fb04446e35 Convert most HTTP links to HTTPS
No real changes, but it's not very serious to use HTTP links in 2025.
2025-03-04 18:03:53 +01:00
Vadim Zeitlin ae2ca287a8 Reuse connection_parameters parsing in SQLite3 backend
Don't duplicate the code for parsing space-separated possibly quoted
words in SQLite3 backend but just use the common function for it too.

Also correct handling of some boolean parameters, where previously
specifying any value, even "0" or "false", would enable it and document
the exact values accepted for them.

Add tests checking that parsing connection string works as expected.
2024-11-09 22:37:13 +01:00
Lukas Zanner 037a332ca7 Add db_type description to docs 2023-10-18 22:28:19 +02:00
Lukas Zanner d4414a3edb Update docs for complete integer type support 2023-08-13 17:25:28 +02:00
Vadim Zeitlin 196ec23418 Add "nocreate" connection option to SQLite3 backend
This allows to avoid creating the database file if it doesn't already
exist as it may sometimes (often?) be undesirable, e.g. when it's
supposed to have been already created and its schema initialized, as
creating an empty database is not really helpful in this case.
2022-11-28 23:35:43 +01:00
Cosmin Cremarenco ae3ff29216 Add support for enforcing foreign keys in SQLite backend
Allow enabling foreign key checking, which is disabled by default in the
current SQLite versions, for the applications that need it using the
appropriate SQLite pragma if the corresponding connection string
parameter is specified.

Closes #968.
2022-05-19 23:51:24 +02:00
Johan Pascal c158d2c67b Support "vfs" flag in SQLite3 backend connection parameters
Allow passing a pre-registered sqlite3 vfs string identifier to the
database open function
2020-06-17 23:54:01 +02:00
Cavaler d6edfe5868 Support "readonly" flag in SQLite3 backend connection parameters
Allow opening the database in read-only mode instead of the default
read-write one.

See #784.
2020-02-06 14:19:33 +01:00
Heiko Rabe 0914287ce2 Update backend docs, add successful tested platform 2018-06-10 21:19:13 +02:00
Astrinus 6eb048a62a Added missing parenthesis and fixed typo 2017-12-20 16:02:00 +01:00
Astrinus 34512ffad3 Fixed broken links in sqlite3.md 2017-12-20 16:00:22 +01:00
Mateusz Loskot 46071f5f64 [docs] Replace HTML tables with Markdown tables
Use fenced code blocks with language specification.
Update database/os/compiler tables for some backends.
2017-09-23 18:14:47 +02:00
Mateusz Loskot 80941a9d97 Update structure of SOCI 4.0.0 documentation
Add MkDocs configuration to build documentation pages.

[ci skip]
2017-08-07 00:45:23 +02:00
Mateusz Loskot c4255c9e3b Delete old /docs folder.
Rename Markdown conversion /doc to /docs
Related to #344
2015-06-30 21:56:21 +02:00