Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Thiago Macieira
On Monday, 28 November 2022 14:29:30 PST Scott Bloom wrote: > While this might be the expectation from the Qt side of the world 😊 On > windows, I don’t know of anyone who does this. Not so uncommon on linux, > but "all" 3rd party? I wouldn’t say that happens often That's not even the expectation

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Scott Bloom
-Original Message- From: Interest On Behalf Of Thiago Macieira Sent: Monday, November 28, 2022 1:41 PM To: interest@qt-project.org Subject: Re: [Interest] Qt Sql BLOB data converting On Monday, 28 November 2022 12:39:05 PST Scott Bloom wrote: > Strict tables were only added in Sql

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Thiago Macieira
On Monday, 28 November 2022 12:39:05 PST Scott Bloom wrote: > Strict tables were only added in Sqlite 3.37, I don't know what version of > sqlite3 is used in Qt6, my version of Qt5.15.6 doesn't support it. Hence the rule of thumb: ALWAYS unbundle the third party content and build the necessary li

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Scott Bloom
-Original Message- From: Interest On Behalf Of Thiago Macieira Sent: Monday, November 28, 2022 12:21 PM To: interest@qt-project.org Subject: Re: [Interest] Qt Sql BLOB data converting On Monday, 28 November 2022 12:07:22 PST Scott Bloom wrote: > but if they did a create XXX as str

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Thiago Macieira
On Monday, 28 November 2022 12:07:22 PST Scott Bloom wrote: > but if they did a create XXX as string, insert XXX=123 (integer) and Sqlite > can return it as a string or an integer, the QVariant should be created > from an string not an integer. The same goes if they did a create XXX as > integer,

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Scott Bloom
-Original Message- From: Interest On Behalf Of Christian Ehrlicher Sent: Monday, November 28, 2022 11:54 AM To: interest@qt-project.org Subject: Re: [Interest] Qt Sql BLOB data converting Am 28.11.2022 um 20:31 schrieb Scott Bloom: > -Original Message- > From: Intere

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Christian Ehrlicher
Am 28.11.2022 um 20:31 schrieb Scott Bloom: -Original Message- From: Interest On Behalf Of Thiago Macieira Sent: Monday, November 28, 2022 11:21 AM To: interest@qt-project.org Subject: Re: [Interest] Qt Sql BLOB data converting On Monday, 28 November 2022 10:59:47 PST Christian

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Scott Bloom
-Original Message- From: Interest On Behalf Of Thiago Macieira Sent: Monday, November 28, 2022 11:21 AM To: interest@qt-project.org Subject: Re: [Interest] Qt Sql BLOB data converting On Monday, 28 November 2022 10:59:47 PST Christian Ehrlicher wrote: > It's because of the dynami

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Scott Bloom
string that has the value 1234 being automatically converted to an integer, and then the value.toString() returning “1234”) Scott From: Yauheni Pervenenka Sent: Monday, November 28, 2022 11:16 AM To: Scott Bloom Cc: Christian Ehrlicher ; interest@qt-project.org Subject: Re: [Interest] Qt Sql BLO

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Thiago Macieira
On Monday, 28 November 2022 10:59:47 PST Christian Ehrlicher wrote: > It's because of the dynamic typing feature of sqlite ( > https://www.sqlite.org/flextypegood.html ) - even a column is created as > one type it can contain another one. Looks like the data was inserted > with the wrong type infor

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Yauheni Pervenenka via Interest
ColumnType > > So the Record is correct, but the return type is of QString not QByteArray > > Scott > > > > > -Original Message- > From: Interest On Behalf Of Christian > Ehrlicher > Sent: Monday, November 28, 2022 10:41 AM > To: Yauheni Pervenenka

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Scott Bloom
then use sqlite3_column_type otherwise it uses qGetColumnType So the Record is correct, but the return type is of QString not QByteArray Scott -Original Message- From: Interest On Behalf Of Christian Ehrlicher Sent: Monday, November 28, 2022 10:41 AM To: Yauheni Pervenenka ; interest@qt

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Yauheni Pervenenka via Interest
Christian, thanks a lot it is work now, fine On Mon, Nov 28, 2022 at 10:01 PM Christian Ehrlicher wrote: > > Am 28.11.2022 um 19:46 schrieb Yauheni Pervenenka: > > Christian, thanks for your effort, db was simplified for test, is it > > possible to fix it on the client side? Any ideas, why is co

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Christian Ehrlicher
Am 28.11.2022 um 19:46 schrieb Yauheni Pervenenka: Christian, thanks for your effort, db was simplified for test, is it possible to fix it on the client side? Any ideas, why is column considered as SQLITE_TEXT if it is BLOB? It's because of the dynamic typing feature of sqlite ( https://www.s

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Yauheni Pervenenka via Interest
I used sqlite3 python module, and it is parsed fine On Mon, Nov 28, 2022 at 9:46 PM Yauheni Pervenenka < yauheni.pervene...@viber.com> wrote: > Christian, thanks for your effort, db was simplified for test, is it > possible to fix it on the client side? Any ideas, why is column considered > as SQ

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Yauheni Pervenenka via Interest
Christian, thanks for your effort, db was simplified for test, is it possible to fix it on the client side? Any ideas, why is column considered as SQLITE_TEXT if it is BLOB? On Mon, Nov 28, 2022 at 9:40 PM Christian Ehrlicher wrote: > > Am 28.11.2022 um 19:16 schrieb Yauheni Pervenenka via Inter

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Christian Ehrlicher
Am 28.11.2022 um 19:40 schrieb Christian Ehrlicher: Am 28.11.2022 um 19:16 schrieb Yauheni Pervenenka via Interest: Thiago, hello, thanks for your reply, sorry have no instructions for create and insert, but have data base with one value which can't be parsed correct(db is cut to one value for

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Christian Ehrlicher
Am 28.11.2022 um 19:16 schrieb Yauheni Pervenenka via Interest: Thiago, hello, thanks for your reply, sorry have no instructions for create and insert, but have data base with one value which can't be parsed correct(db is cut to one value for provide example) https://bugreports.qt.io/browse/QTB

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Yauheni Pervenenka via Interest
Thiago, hello, thanks for your reply, sorry have no instructions for create and insert, but have data base with one value which can't be parsed correct(db is cut to one value for provide example) https://bugreports.qt.io/browse/QTBUG-108992 On Mon, Nov 28, 2022 at 9:07 PM Thiago Macieira wrote:

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Thiago Macieira
On Monday, 28 November 2022 01:00:01 PST Yauheni Pervenenka via Interest wrote: > QSqlQuery query("SELECT value from table"); > while (query.next()) { > const auto value = query.value(0); > qDebug() << value.toByteArray().size(); // size 52 > qDebug() << value.toString().size(); // size 30 > qDebu

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Yauheni Pervenenka via Interest
Hello, Henry, thanks for the reply, seems like no, there is simple code QSqlQuery query("SELECT value from table"); while (query.next()) { const auto value = query.value(0); qDebug() << value.toByteArray().size(); // size 52 qDebug() << value.toString().size(); // size 30 qDebug() << value.toByteA

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Henry Skoglund
On 2022-11-28 09:32, Yauheni Pervenenka via Interest wrote: Hi, Tony, thanks for your reply, OS: win 11 DB: SQLite Unfortunately, QVariant::toByteArray returns size 52(hex 104), QVariant::toString returns size 30 There is data returned by QVariant::toByteArray::toHex Qt data in hex(size 104):

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Yauheni Pervenenka via Interest
Hi, Tony, thanks for your reply, OS: win 11 DB: SQLite Unfortunately, QVariant::toByteArray returns size 52(hex 104), QVariant::toString returns size 30 There is data returned by QVariant::toByteArray::toHex Qt data in hex(size 104): 763130492d46c2ab4cc29c7bc2b0efbfbd78c29b29c3ab1e4723dea6efbfbde

Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Tony Rietwyk
Hi Yauheni, You don't say which type of database you are using?  There may be issues with the database client library altering the blob to UTF8.  Though I would expect the python code using the same client to have the same problem. Assuming that QVariant has the byte array unaltered, then Q

[Interest] Qt Sql BLOB data converting

2022-11-27 Thread Yauheni Pervenenka via Interest
Hello, community I have faced with issue that qvariant using qstrlen for getting data size, but sometimes it returns wrong size especially for BLOB data(if there are some special symbols), are there any way to get data correct? Note: Database value 34, python returns correct data size, but qvarian