143 Commits

Author SHA1 Message Date
gwenn
0c3933b68c clippy::use_self 2024-08-10 14:39:36 +02:00
gwenn
a46ba32799 Fix warning
use of deprecated unit variant `cc::windows_registry::VsVers::Vs12`: Visual Studio 12 is no longer supported. cc will never return this value.
2024-07-20 09:33:36 +02:00
gwenn
7a66d4a632 Fix clippy warnings 2024-07-20 09:32:12 +02:00
gwenn
799360372f The SQLITE_ENABLE_STAT2 compile-time option is now a no-op. 2024-07-20 09:30:35 +02:00
Yuri Astrakhan
c32d7a79a2 Applied some spellchecker suggestions 2024-07-17 13:41:16 -04:00
southorange0929
1886a0a5ef feat: sync openssl search logic 2024-05-15 09:23:22 +08:00
southorange0929
a7d5d33548 fix: build should support lib64 dir for OpenSSL3.x 2024-05-13 18:03:35 +08:00
gwenn
57a3a8f62e
Add bindings to automatic extension loading API (#1487)
* Add bindings to automatic extension loading API

it doesn't seem possible to directly register an `AutoExtension`.
2024-03-30 17:01:44 +01:00
gwenn
4390720f9d Omit API
sqlite3_close_v2 (for gced languages)
sqlite3_create_collation (vs sqlite3_create_collation_v2)
sqlite3_create_function (vs sqlite3_create_function_v2)
sqlite3_create_module (vs sqlite3_create_module_v2)
sqlite3_prepare (vs sqlite3_prepare_v2/v3)
2024-03-23 10:55:00 +01:00
gwenn
ab5bb268be Omit UTF-16 API 2024-03-23 10:05:49 +01:00
gwenn
5d148358d6 Fix clippy warnings 2024-03-15 19:23:36 +01:00
John Vandenberg
52b01e40b2 Fix a few typos 2024-02-01 16:46:59 +08:00
Georg Semmler
e60d993cc4
Expose the include directory of the bundled sqlite version
This commit exposes the include directory of the bundled sqlite version
via by instructing cargo to set the `DEP_SQLITE3_INCLUDE` enviroment
variable as documented in the cargo book:
https://doc.rust-lang.org/cargo/reference/build-script-examples.html#using-another-sys-crate

This enables other sys crates to rely on the bundled sqlite version and
use it as base for their compilation if they have a (sub-)dependency on
libsqlite3.
2024-01-25 11:39:21 +01:00
gwenn
8a5e2e6f63 Fix clippy warning 2024-01-06 16:46:29 +01:00
gwenn
01a2cc51a5 Drop winsqlite3 feature 2024-01-06 16:35:18 +01:00
gwenn
3c3d7daeb4 Fix uninlined_format_args
cargo clippy --all --all-targets --fix -- -Wclippy::uninlined_format_args
2023-12-23 14:21:23 +01:00
gwenn
c2fbd167de
Merge pull request #1332 from etehtsea/wasi-example
Improve wasm32-wasi support
2023-11-25 18:03:21 +01:00
gwenn
e8c35fce50 Replace ::atomic::Atomic by std AtomicPtr
NoUninit constraint cannot be satisfied
2023-11-11 20:11:37 +01:00
gwenn
3742efe24c Omit deprecated functions 2023-07-15 10:24:51 +02:00
gwenn
f9d69410ef Fix panic at 'SQLite API not initialized or SQLite feature omitted'
`to_sqlite_error` needs `sqlite3_malloc`

```
sqlite> .log on
sqlite> .load target/debug/examples/libloadable_extension.so
Error: error during initialization: SQLite version mismatch: 3014000 < 3042000
```
2023-07-14 15:56:43 +02:00
gwenn
81585a75cb Add Connection::extension_init2 2023-07-09 15:53:03 +02:00
gwenn
92c536b622 Remove parse_macros (fails with wrapper_ext.h) 2023-07-09 14:17:19 +02:00
gwenn
1308cdaa9d Loadable extension 2023-07-09 12:50:49 +02:00
gwenn
60f5cef17b Factorize code in build.rs 2023-07-09 09:21:40 +02:00
gwenn
44edb4b459 Fix clippy warning 2023-07-08 11:11:14 +02:00
gwenn
58113b0777 Simplify bindgen generation
`rusqlite` users cannot use old versions (< 3.8.3) of SQLite anymore.
And `libsqlite3-sys` users should not use SQLITE_DETERMINISTIC when
using SQLite < 3.8.3.
2023-07-08 10:39:36 +02:00
gwenn
518f0195df Tweak bindgen 2023-06-18 11:48:15 +02:00
gwenn
567a871e70 Tweak bindgen 2023-06-17 16:09:53 +02:00
gwenn
6e9d8eafde Fix type of SQLITE_DESERIALIZE_*, SQLITE_PREPARE_*, SQLITE_SERIALIZE_* 2023-06-04 10:31:44 +00:00
gwenn
9d502c4995 Use SQLITE_PREPARE_PERSISTENT for CachedStatement 2023-06-03 11:17:19 +02:00
Konstantin Shabanov
5534eb93c6
Improve wasm32-wasi support
[Starting from 3.41.0 SQLite has wasm32-wasi support out of the
box.][0]

- Set `-DSQLITE_THREADSAFE=0`. Fixes:

```
$ wasmtime target/wasm32-wasi/release/examples/persons.wasm
Error: failed to run main module `target/wasm32-wasi/release/examples/persons.wasm`

Caused by:
    0: failed to instantiate "target/wasm32-wasi/release/examples/persons.wasm"
    1: unknown import: `env::pthread_mutexattr_init` has not been defined
```

- Drop `-DSQLITE_OS_OTHER`. Fixes:

```
$ wasmtime target/wasm32-wasi/release/examples/persons.wasm
Error: failed to run main module `target/wasm32-wasi/release/examples/persons.wasm`

Caused by:
    0: failed to instantiate "target/wasm32-wasi/release/examples/persons.wasm"
    1: unknown import: `env::sqlite3_os_init` has not been defined
```

- [Add wasi specific build flags][1]
- Add basic example
- Also, add instructions how to run it against wasm32-wasi.

Using of file databases is also working, though `--mapdir` arg
should be provided to `wasmtime run`.

[0]: https://wasmlabs.dev/articles/sqlite-wasi-support/
[1]: https://github.com/vmware-labs/webassembly-language-runtimes/blob/main/libs/sqlite/wasi-patches/wlr-build.sh#L11
2023-05-25 22:26:56 +06:00
Nop Jiarathanakul
4c6d915d0f add SQLITE_MAX_COLUMN compile option 2023-05-09 13:19:25 -07:00
Stanislav Golubtsov
ef4a0ac09d fix compilation for target wasm32-wasi 2023-05-02 18:32:56 +02:00
icp
b4604f2421
Force linking against system sqlite libs
This commit introduces new env var, LIBSQLITE3_SYS_USE_PKG_CONFIG,
which can be set to non-zero values to force building against sqlite
libraries from the system overriding bundled features.
2023-04-17 01:23:40 +05:30
gwenn
1180a4f943 Fix clippy warning 2023-04-14 20:55:16 +02:00
gwenn
7dac07be13 Rustfmt 2023-03-25 16:15:05 +01:00
gwenn
a5c460a8f7 Fix sqlite3_cancel_auto_extension 2023-03-25 15:38:24 +01:00
gwenn
bef2472bfb Fix sqlite3_auto_extension xEntryPoint signature 2023-03-25 11:47:27 +01:00
gwenn
c5f0b27693 Fix sqlite3_auto_extension xEntryPoint signature 2023-03-25 11:33:33 +01:00
gwenn
420bf08489 Fix clippy warnings 2023-03-25 10:34:47 +01:00
gwenn
eb7fbc57d0 Use ParseCallbacks::item_name to fix sqlite3_index_info_* types 2023-03-25 10:19:56 +01:00
ssrlive
279be83bcf
Update build.rs 2022-12-23 09:31:58 +08:00
ssrlive
8785bd903a
Update build.rs 2022-12-22 21:05:48 +08:00
gwenn
6d509afe49 Clippy 2022-10-28 19:02:49 +02:00
gwenn
2dd11143c9 Remove min_sqlite_version_3_7_16 feature
And associated bindgen
2022-08-30 13:05:47 -07:00
gwenn
6766d6a6cd Remove old_sqlite feature
And associated bindgen_3.6.8.rs
2022-08-30 13:05:47 -07:00
gwenn
6e740d0611 Change default minimal SQLite API version
From 3.6.8 to 3.14.0.
Use `old_sqlite` feature to keep 3.6.8 (or 3.7.16) as the minimal version.
Use `modern_sqlite` for SQLite API > 3.14.0.
Also remove old 3.6.23 and 3.7.7 bindings.
2022-08-30 13:05:47 -07:00
Daniel Kahn Gillmor
53b1b598cb Drop bindgen layout tests
The auto-generated bindgen layout tests are architecture dependent and
cause breakage on 32-bit platforms at least.

Note that this does not yet remove the layout tests from
bindgen-bindings/bindgen_*.rs -- i'm not sure how those are generated.

Addresses: #722
2022-08-16 14:26:58 -07:00
gwenn
618e9a1274 Clean code
Typos, deprecated code usages, ...
2022-05-29 13:33:51 +02:00
gwenn
c10e2f39ef clippy::single_match_else 2022-01-06 04:56:59 -08:00