We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When you attach a SQLite database from DuckDB, and you try to insert BLOBs into a SQLite table, the values get bound as TEXT instead of BLOBs.
import duckdb db = duckdb.connect(":memory:") db.execute("load sqlite;") db.execute("attach 'tmp.db' as target (type sqlite);") db.execute("create table target.x(a blob);") db.execute("insert into target.x(a) select encode('my_string_with_ü')"); db.close() import sqlite3 db = sqlite3.connect("tmp.db") print(db.execute("select typeof(a) from x").fetchone()[0])
The final line prints text, which means a was bound as TEXT and not a BLOB.
text
a
I believe this is because of this code, where SQLiteStatement::BindValue binds BLOBs with BindText, and a new BindBlob option could be added. https://github.com/duckdb/sqlite_scanner/blob/50b7870be099186f195bc72bac5e9e11247ee2f9/src/sqlite_stmt.cpp#L154-L157
SQLiteStatement::BindValue
BindText
BindBlob
MacOS aarch64
3.44.2
0.10.3
Python
Alex Garcia
self
main
The text was updated successfully, but these errors were encountered:
Fixed in #98
Sorry, something went wrong.
No branches or pull requests
What happens?
When you attach a SQLite database from DuckDB, and you try to insert BLOBs into a SQLite table, the values get bound as TEXT instead of BLOBs.
To Reproduce
The final line prints
text
, which meansa
was bound as TEXT and not a BLOB.I believe this is because of this code, where
SQLiteStatement::BindValue
binds BLOBs withBindText
, and a newBindBlob
option could be added. https://github.com/duckdb/sqlite_scanner/blob/50b7870be099186f195bc72bac5e9e11247ee2f9/src/sqlite_stmt.cpp#L154-L157OS:
MacOS aarch64
SQLite Version:
3.44.2
DuckDB Version:
0.10.3
DuckDB Client:
Python
Full Name:
Alex Garcia
Affiliation:
self
Have you tried this on the latest
main
branch?Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
The text was updated successfully, but these errors were encountered: