Re: [sqlite] Size query

2010-11-03 Thread Stephen Chrzanowski
But wouldn't you be aware of what the data is you want to transmit anyways? Sure, it thinks as 1 as a length of 5, but, you'll know that you'll need to send 4 or 8 bytes. On Wed, Nov 3, 2010 at 6:50 PM, Scott A Mintz wrote: > If x is numeric length(x) returns the

Re: [sqlite] Size query

2010-11-03 Thread Samuel Adam
On Wed, 03 Nov 2010 19:17:48 -0400, Samuel Adam wrote: > SQLite uses its own variable-length integer representation > internally, occupying between 1 and 64 bits per value; if this is for a Sorry to reply to my own post; I wish to be precise. By “internally”, I meant

Re: [sqlite] Size query

2010-11-03 Thread Samuel Adam
On Wed, 03 Nov 2010 18:24:57 -0400, Scott A Mintz wrote: > Is it possible to construct a query that will tell me the total size in > bytes of the result set? Specifically, in a messaging protocol that > returns data we need to fragment the reply and it would be nice

Re: [sqlite] Size query

2010-11-03 Thread Samuel Adam
On Wed, 03 Nov 2010 18:35:52 -0400, Stephen Chrzanowski wrote: > Couldn't you do something like: > > select length(FieldName) from TableName where Condition=True > > ? > > The result would be the size. Otherwise, the only thing I can think of Caution: This will return

Re: [sqlite] Size query

2010-11-03 Thread Scott A Mintz
If x is numeric length(x) returns the length of x expressed as a string. So the value of length(1 ) is 5, not 2. -Scott sqlite-users-boun...@sqlite.org wrote on 11/03/2010 06:35:52 PM: > Couldn't you do something like: > > select length(FieldName) from TableName where Condition=True > >

Re: [sqlite] Size query

2010-11-03 Thread Stephen Chrzanowski
Couldn't you do something like: select length(FieldName) from TableName where Condition=True ? The result would be the size. Otherwise, the only thing I can think of is just doing a select to get the results you want, then just keep a running tally on what would need to be transmitted, then do

[sqlite] Size query

2010-11-03 Thread Scott A Mintz
Is it possible to construct a query that will tell me the total size in bytes of the result set? Specifically, in a messaging protocol that returns data we need to fragment the reply and it would be nice to know how much data or how many packets will be required to send the response. Thanks,

Re: [sqlite] sqlite from fossil

2010-11-03 Thread Benjamin Peterson
Richard Hipp writes: > Try setting: > > fossil setting autosync off > > before you do the > > fossil update I actually get this from "fossil clone http://sqlite.org/src;, too. ___ sqlite-users mailing list

Re: [sqlite] sqlite from fossil

2010-11-03 Thread Richard Hipp
On Wed, Nov 3, 2010 at 5:30 PM, Benjamin Peterson wrote: > PF writes: > > > You need to set: > > fossil setting manifest on > > Thanks. Now "fossil update" says. > > fossil: server says: login failed > > Try setting: fossil setting autosync off before you

Re: [sqlite] sqlite from fossil

2010-11-03 Thread Benjamin Peterson
PF writes: > You need to set: > fossil setting manifest on Thanks. Now "fossil update" says. fossil: server says: login failed ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] A question about transactions

2010-11-03 Thread Igor Tandetnik
Pavel Ivanov wrote: >> Yes. That's precisely the intended use case. Remember though that the >> transaction is not really committed until COMMIT statement >> runs: if your application crashes or machine loses power, all changes to the >> beginning of the transaction are

Re: [sqlite] A question about transactions

2010-11-03 Thread Pavel Ivanov
> Yes. That's precisely the intended use case. Remember though that the > transaction is not really committed until COMMIT statement runs: if your > application crashes or machine loses power, all changes to the beginning of > the transaction are rolled back, not just those since last

Re: [sqlite] A question about transactions

2010-11-03 Thread Igor Tandetnik
jeff archer wrote: > I am using SQLite from C++ and I have implemented a class to manager nested > transactions using savepoints. I have currently implemented as a stack of > transactions such that the first Begin uses BEGIN IMMEDIATE, while subsequent > levels use SAVEPOINT

[sqlite] Concurrency problem

2010-11-03 Thread Yan Burman
Hi. I use sqlite in my code for a while now, and at first I parsed all queries each time, but now I'm migrating my code to using prepared statements (using sqlite3_prepare_v2 and binding parameters). At some point I started receiving 'library routine called out of sequence' error every now

Re: [sqlite] Using sqlite's WAL with a hash table store

2010-11-03 Thread Jay A. Kreibich
On Wed, Nov 03, 2010 at 05:10:22PM +0300, Alexey Pechnikov scratched on the wall: > 2010/11/3 Jay A. Kreibich > > > > Why not just use an off-the-self hash cache, like memcached, or an > > off-the-self hash database, like Redis? Redis even supports an > > Append-Only write

[sqlite] Problem with

2010-11-03 Thread uncle.f
Hello, We are running SQLite 3.7.3 on an embedded device and using C API to interact with the DB. One of our goals is to ensure that the database on disk never grows past certain size. We open DB connection once and it stays open for the whole duration of C application. The following PRAGMAs are

Re: [sqlite] 'no such column' error returned in a CASE statement

2010-11-03 Thread Ioannis Epaminonda
Pavel Ivanov-2 wrote: > > > Yes, it's expected. Column aliases are visible only in GROUP BY/ORDER > BY/HAVING clauses and outer selects. All other places should use exact > column expression instead. > > Pavel > > Ah, thanks Pavel for the clarification, now it makes sense. This is a bit

Re: [sqlite] Using sqlite's WAL with a hash table store

2010-11-03 Thread Alexey Pechnikov
2010/11/3 Jay A. Kreibich > > Why not just use an off-the-self hash cache, like memcached, or an > off-the-self hash database, like Redis? Redis even supports an > Append-Only write mode (e.g. WAL-ish journal mode). > How about power fail or OS crash? As I know, Redis does

[sqlite] A question about transactions

2010-11-03 Thread jeff archer
I am using SQLite from C++ and I have implemented a class to manager nested transactions using savepoints.  I have currently implemented as a stack of transactions such that the first Begin uses BEGIN IMMEDIATE, while subsequent levels use SAVEPOINT T where is a sequentially increasing

Re: [sqlite] Using sqlite's WAL with a hash table store

2010-11-03 Thread Ben Harper
Interesting.. thanks. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Jay A. Kreibich Sent: 03 November 2010 03:44 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Using sqlite's WAL with a hash table store

[sqlite] [FTS4] Suggestions...

2010-11-03 Thread Shopsland gmail
Hi, I saw in the timeline that Sqlite developers are working on FTS4. Great news! :-) I would like to suggest a couple of fixes. The following syntax involving two or more words and double quotes returns an error:   ...MATCH 'Electric car -"general motors"'   ...MATCH 'Electric car

Re: [sqlite] Using sqlite's WAL with a hash table store

2010-11-03 Thread Jay A. Kreibich
On Wed, Nov 03, 2010 at 12:31:35PM +0200, Ben Harper scratched on the wall: > I guess I could actually dump the hash table into a blob. > I'm also doing something like a bloom filter, and I guess that can just > as well go into a blob too.. Basically the system is a big cache, > and it must

Re: [sqlite] filling an in-memory database from a byte stream?

2010-11-03 Thread Richard Hipp
On Tue, Nov 2, 2010 at 12:04 PM, Niemann, Hartmut < hartmut.niem...@siemens.com> wrote: > Hello *! > > I am investigating using sqlite (with Java) as a readonly database in a > viewer application. > One problem is that the database can reside not only on the local hard > disc, but also on a >

[sqlite] filling an in-memory database from a byte stream?

2010-11-03 Thread Niemann, Hartmut
Hello *! I am investigating using sqlite (with Java) as a readonly database in a viewer application. One problem is that the database can reside not only on the local hard disc, but also on a possibly slowly connected remote system that can be contacted only via ftp or some proprietary

Re: [sqlite] Using sqlite's WAL with a hash table store

2010-11-03 Thread Ben Harper
Thanks - I didn't think of using that. Maybe it's a good fit. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Alexey Pechnikov Sent: 03 November 2010 11:51 AM To: General Discussion of SQLite Database Subject: Re: [sqlite]

Re: [sqlite] Using sqlite's WAL with a hash table store

2010-11-03 Thread Ben Harper
I guess I could actually dump the hash table into a blob. I'm also doing something like a bloom filter, and I guess that can just as well go into a blob too.. Basically the system is a big cache, and it must quickly answer the question "Do you have this item in your cache?". The cache is going

Re: [sqlite] Using sqlite's WAL with a hash table store

2010-11-03 Thread Alexey Pechnikov
FTS3 extension is very fast and scalable hash engine. I did test FTS3 up to 400+ millions of record and it's nice. 2010/11/3 Ben Harper > Hi, > I know the answer to this question is really "Just try it and see", but I > want to gauge whether the idea is sane or not before I

Re: [sqlite] Using sqlite's WAL with a hash table store

2010-11-03 Thread Simon Slavin
On 3 Nov 2010, at 8:30am, Ben Harper wrote: > I know the answer to this question is really "Just try it and see", but I > want to gauge whether the idea is sane or not before I spend/waste time on > the effort: > > I want to build a custom hash table DB, and to solve the >

[sqlite] Using sqlite's WAL with a hash table store

2010-11-03 Thread Ben Harper
Hi, I know the answer to this question is really "Just try it and see", but I want to gauge whether the idea is sane or not before I spend/waste time on the effort: I want to build a custom hash table DB, and to solve the concurrency+durability I need something akin to a WAL, and SQLite's WAL