Comments (11)
Also noticing:
unsafe {
sqlite3_soft_heap_limit64(1024);
let soft_limit = sqlite3_soft_heap_limit64(-1);
sqlite3_hard_heap_limit64(1024);
let hard_limit = sqlite3_hard_heap_limit64(-1);
println!("Soft limit: {} hard limit: {}", soft_limit, hard_limit);
}
Soft limit: 1024 hard limit: 0
from rusqlite.
Are you sure that it is related to rusqlite
?
What happens if you use only C or any other language bindings ?
from rusqlite.
conn.pragma_update(
Some(rusqlite::DatabaseName::Main),
"hard_heap_limit",
rusqlite::types::Value::Integer(1024),
)?;
conn.pragma_query(Some(rusqlite::DatabaseName::Main),
"hard_heap_limit", |row | -> Result<()> {
println!("hard heap limit pragma: {:?}", row);
Ok(())
}).unwrap();
also returns
hard heap limit pragma: {Ok("hard_heap_limit"): (Integer, 0)}
from rusqlite.
@gwenn I've just checked the SQLite cli on macOS:
dangoodman: ~/code/learningRust/sqlite-test git:(main) ✗ sqlite3 9:35AM
SQLite version 3.43.2 2023-10-10 13:08:14
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> PRAGMA hard_heap_limit;
0
sqlite> PRAGMA hard_heap_limit = 1024;
0
sqlite> PRAGMA hard_heap_limit;
0
sqlite> PRAGMA hard_heap_limit=1024;
0
sqlite> PRAGMA hard_heap_limit;
0
sqlite>
I assume this is compiled with the defaults which should allow it to be enabled as well
Seeing similar behavior with soft heap limits as the code:
sqlite> PRAGMA soft_heap_limit;
0
sqlite> PRAGMA soft_heap_limit=1024;
1024
sqlite> PRAGMA soft_heap_limit;
1024
from rusqlite.
Curious that it can't see it's own memory usage though as well no? All the checks and build flags indicate that this should be available. I'm not familiar with how to quickly test in another language that has such low level bindings to SQLite.
from rusqlite.
In case you don't know, you can ask for help here:
https://sqlite.org/forum/forum
but mainly for "official" projects or "general" questions related to SQLite.
from rusqlite.
Thanks, I wasn’t sure how much this might have been related to the build flags or any other config that might have been crate specific
from rusqlite.
You can use bundled
feature temporarily if you are not sure of the flags used by your system library.
rusqlite = {version = "0.31.0", features = ["hooks", "bundled"]}
from rusqlite.
Will this use the flags from the crate build.rs?
from rusqlite.
Yes, these ones:
rusqlite/libsqlite3-sys/build.rs
Lines 121 to 140 in b1b26af
from rusqlite.
@gwenn thanks for the help, testing with a GH codespace using the provided sqlite I got:
config mem status enabled
Memory tracking is enabled. Current memory usage: 16168 bytes, Highwater mark: 16184 bytes
PRAGMA soft_heap_limit set to 1024
soft_heap_limit pragma: {Ok("soft_heap_limit"): (Integer, 1024)}
PRAGMA hard_heap_limit set to 1024
Error: SqliteFailure(Error { code: OutOfMemory, extended_code: 7 }, Some("out of memory"))
I assume bundling would also perform the same.
It seems the issue was my local version of sqlite on macOS!
from rusqlite.
Related Issues (20)
- Trait for abstracting over `Connection`/`Transaction`? HOT 3
- SqlInputError { error: Error { code: Unknown, extended_code: 1 }, msg: "unrecognized token: \"{\"" HOT 1
- Release 0.31.0 with SQLite 3.45? HOT 2
- Type issue on select with digits only in a "string" colums. HOT 2
- wasm32-wasi target fails on Apple M3
- How to get "returning *" from insert HOT 3
- Stale Connection Handler on Multi-Threaded Situation HOT 2
- sqlite3_snapshot iteration HOT 2
- Creating `Value::Blob` without necessarily allocating heap HOT 5
- Using rusqlite::vtab::VTabConnection::handle() HOT 4
- Add bindings for `sqlite3_trace_v2` API HOT 4
- iOS Linker Warning: SQLite was build for newer version than being linked HOT 2
- the first query is failure due to below error HOT 1
- Segmentation fault when writing encrypted database with vendored SQLCipher and OpenSSL on OpenBSD
- Adding feature `array` seems to cause a compile failure HOT 1
- Allow provinding own sqlite3.c
- libsqlite3-sys build broken for visionos with feature `bundled` HOT 1
- New release with sqlite 3.46 HOT 5
- wasm32-wasip1-threads, passing `atomics` and `bulk-memory` option
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rusqlite.