Re: [sqlite] How to "upgrade" a DB without write access to its file, or to the direction it's in?

2013-08-19 Thread _ph_
Another option: Copy the meta-data to an in-memory-DB. As you "load all meta
data into memory" anyway this seems a viable option.

ATTACH ':memory:' AS mem
INSERT INTO mem.Table SELECT * FROM Table

(repeat for each table, you may want to create/recreate constraint and
indices in the attached DB, of course)

During this copy, you can make the schema adjustments. 

---

I'm storing both raw and meta data in an SQLite DB, create that
in-memory-copy only for the meta data, and use this as the
in-memory-representation - no separate C++ class graph for the data
structure. 

(There's basically a C++ class for each table holding one row, and fille on
demand from the in memory db. It's not blazingly fast - you can quickly
accumulate a few ms for a bunch of queries - but good enough certainly, and
fun to use.)

When creating that "snapshot", I make adjustments to the schema, so read
compatibility is in one place. 



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/How-to-upgrade-a-DB-without-write-access-to-its-file-or-to-the-direction-it-s-in-tp70408p70574.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite4 question

2013-08-19 Thread Saito, Takuya
>On 19 Aug 2013, at 10:15am, Dan Kennedy  wrote:
>
>> Do permissions on files "ex1", "ex1-shm" or "ex1-log" and the
>> directory look Ok? Is the file-system local?
>
>Did it actually make three files with this name ?  Were they in a folder you 
>have write privileges for ?
>
>I have a vague memory that 'ex1' is actually a device name under Linux but 
>that may be 20 years old.
>
>Can you try it again, but this time specify a full path name for your database:
>
>sqlite4 /usr//test1.sqlite
>
>Simon.

Yes, the three files made with these names, and the files is made in the folder 
I have write privileges for.
And I tried it with a full path name for the database as you showed me.
But I got the same response ("Error: locking protocol").

Thanks,
Takuya.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



[Mitsubishi Electric Group]

KH-Automation Projects GmbH | Geschäftsführer: Manfred Pfaar, Hartmut Pütz, 
Tsuyoshi Kobayashi | Handelsregister: RG Kassel HT-Nr. B-7493 | Ust-IdNr.: 
DE813155353 | Sitz der Gesellschaft: Fuldabrück

Über das Internet versandte Emails können von Unbefugten verfälscht oder unter 
fremden Namen erstellt werden.
Wir verwenden ein handelsübliches Viren-Schutzprogramm, dennoch können wir 
Computerviren und ähnliches nicht ausschließen.
Diese E-Mail ist vertraulich und allein für den Gebrauch durch die vorgesehenen 
Empfänger bestimmt.
Wenn Sie nicht der bestimmungsgemäße Empfänger sind, löschen Sie bitte die 
E-Mail.

[EFQM - Recognised for excellence 4 star - 2012]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLITE_DEFAULT_AUTOVACUUM not preserved for in-memory-db

2013-08-19 Thread _ph_
[edit] this is of course 3.*7*.12 and 3.*7*.17



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/SQLITE-DEFAULT-AUTOVACUUM-not-preserved-for-in-memory-db-tp70571p70572.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLITE_DEFAULT_AUTOVACUUM not preserved for in-memory-db

2013-08-19 Thread _ph_
When compiling the amalgamation with 

#define SQLITE_DEFAULT_AUTOVACUUM 2

and creating an in-memory-DB, 

pragma auto_vacuum 

will return 0 (confirmed on 3.1.12, 3.1.17)

Doing this in a disk DB, or after changing it at runtime (pragma
auto_vacuum=N; VACUUM;), auto_vacuum will return the expected value.

--- 

This is not an issue for me - and I'm not sure if auto_vacuum is even
relevant for an in-memory-db, so a note in the documentation might be
sufficient. Yet it did trigger a unit test (and it took me longer than I am
willing to admit to find the cause). 



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/SQLITE-DEFAULT-AUTOVACUUM-not-preserved-for-in-memory-db-tp70571.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite4 question

2013-08-19 Thread Simon Slavin

On 19 Aug 2013, at 10:15am, Dan Kennedy  wrote:

> Do permissions on files "ex1", "ex1-shm" or "ex1-log" and the
> directory look Ok? Is the file-system local?

Did it actually make three files with this name ?  Were they in a folder you 
have write privileges for ?

I have a vague memory that 'ex1' is actually a device name under Linux but that 
may be 20 years old.

Can you try it again, but this time specify a full path name for your database:

sqlite4 /usr//test1.sqlite

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SELECT Count

2013-08-19 Thread Alessandro Marzocchi
Maybe select count(*) where ...?
Alessandro
Il giorno 19/ago/2013 11:38, "techi eth"  ha scritto:

> Hi,
>
> What is the way to get number of possible count matching with criteria for
> SELECT?
>
> SELECT Colum from Table WHERE Criteria
>
> I tried with sqlite3_count_changes() & sqlite3_data_count() function but
> they are not returning actual value.
>
> Definitely getting Colum count by sqlite3_coloum_count () & doing
> sqlite3_step () for each row will get me result but I am looking better way
> to get the result (May be one of register function).
>
> Bye--
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite4 question

2013-08-19 Thread Saito, Takuya
>>On 08/19/2013 03:44 PM, Saito, Takuya wrote:
>> Hi,
>>
>> I have a problem with sqlite4.
>>
>> When I tried to create a table,  the locking protocol error occurred.
>>
>>$sqlite4 ex1
>>SQLite version 4.0.0 2013-07-31 17:43:18
>>Enter ".help" for instructions
>>Enter SQL statements terminated with a ";"
>>sqlite> create table tbl1(one varchar(10), two smallint);
>>Error: locking protocol
>>
>> I want to know why locking protocol error has occurred.
>>
>> I downloaded "qce1a04efd"(2013-07-31 17:43:18) from sqlite.org and compiled 
>> it with "Makefile.linux-gcc".
>>
>> This is a result of "uname -a".
>> Linux [hostname] 3.0.76-0.11-pae #1 SMP Fri Jun 14 08:21:43 UTC 2013
>> (ccab990) i686 i686 i386 GNU/Linux

>Do permissions on files "ex1", "ex1-shm" or "ex1-log" and the directory look 
>Ok? Is the file-system local?
>
>Dan.

Yes, It looks Ok, and file-system is local.

Takuya.




[Mitsubishi Electric Group]

KH-Automation Projects GmbH | Geschäftsführer: Manfred Pfaar, Hartmut Pütz, 
Tsuyoshi Kobayashi | Handelsregister: RG Kassel HT-Nr. B-7493 | Ust-IdNr.: 
DE813155353 | Sitz der Gesellschaft: Fuldabrück

Über das Internet versandte Emails können von Unbefugten verfälscht oder unter 
fremden Namen erstellt werden.
Wir verwenden ein handelsübliches Viren-Schutzprogramm, dennoch können wir 
Computerviren und ähnliches nicht ausschließen.
Diese E-Mail ist vertraulich und allein für den Gebrauch durch die vorgesehenen 
Empfänger bestimmt.
Wenn Sie nicht der bestimmungsgemäße Empfänger sind, löschen Sie bitte die 
E-Mail.

[EFQM - Recognised for excellence 4 star - 2012]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SELECT Count

2013-08-19 Thread techi eth
Hi,

What is the way to get number of possible count matching with criteria for
SELECT?

SELECT Colum from Table WHERE Criteria

I tried with sqlite3_count_changes() & sqlite3_data_count() function but
they are not returning actual value.

Definitely getting Colum count by sqlite3_coloum_count () & doing
sqlite3_step () for each row will get me result but I am looking better way
to get the result (May be one of register function).

Bye--
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite4 question

2013-08-19 Thread Dan Kennedy

On 08/19/2013 03:44 PM, Saito, Takuya wrote:

Hi,

I have a problem with sqlite4.

When I tried to create a table,  the locking protocol error occurred.

   $sqlite4 ex1
   SQLite version 4.0.0 2013-07-31 17:43:18
   Enter ".help" for instructions
   Enter SQL statements terminated with a ";"
   sqlite> create table tbl1(one varchar(10), two smallint);
   Error: locking protocol

I want to know why locking protocol error has occurred.

I downloaded "qce1a04efd"(2013-07-31 17:43:18) from sqlite.org and compiled it with 
"Makefile.linux-gcc".

This is a result of "uname -a".
Linux [hostname] 3.0.76-0.11-pae #1 SMP Fri Jun 14 08:21:43 UTC 2013 (ccab990) 
i686 i686 i386 GNU/Linux


Do permissions on files "ex1", "ex1-shm" or "ex1-log" and the
directory look Ok? Is the file-system local?

Dan.





Thanks,
Takuya



[Mitsubishi Electric Group]

KH-Automation Projects GmbH | Gesch?ftsf?hrer: Manfred Pfaar, Hartmut P?tz, 
Tsuyoshi Kobayashi | Handelsregister: RG Kassel HT-Nr. B-7493 | Ust-IdNr.: 
DE813155353 | Sitz der Gesellschaft: Fuldabr?ck

?ber das Internet versandte Emails k?nnen von Unbefugten verf?lscht oder unter 
fremden Namen erstellt werden.
Wir verwenden ein handels?bliches Viren-Schutzprogramm, dennoch k?nnen wir 
Computerviren und ?hnliches nicht ausschlie?en.
Diese E-Mail ist vertraulich und allein f?r den Gebrauch durch die vorgesehenen 
Empf?nger bestimmt.
Wenn Sie nicht der bestimmungsgem??e Empf?nger sind, l?schen Sie bitte die 
E-Mail.

[EFQM - Recognised for excellence 4 star - 2012]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLite4 question

2013-08-19 Thread Saito, Takuya
Hi,

I have a problem with sqlite4.

When I tried to create a table,  the locking protocol error occurred.

  $sqlite4 ex1
  SQLite version 4.0.0 2013-07-31 17:43:18
  Enter ".help" for instructions
  Enter SQL statements terminated with a ";"
  sqlite> create table tbl1(one varchar(10), two smallint);
  Error: locking protocol

I want to know why locking protocol error has occurred.

I downloaded "qce1a04efd"(2013-07-31 17:43:18) from sqlite.org and compiled it 
with "Makefile.linux-gcc".

This is a result of "uname -a".
Linux [hostname] 3.0.76-0.11-pae #1 SMP Fri Jun 14 08:21:43 UTC 2013 (ccab990) 
i686 i686 i386 GNU/Linux

Thanks,
Takuya



[Mitsubishi Electric Group]

KH-Automation Projects GmbH | Gesch?ftsf?hrer: Manfred Pfaar, Hartmut P?tz, 
Tsuyoshi Kobayashi | Handelsregister: RG Kassel HT-Nr. B-7493 | Ust-IdNr.: 
DE813155353 | Sitz der Gesellschaft: Fuldabr?ck

?ber das Internet versandte Emails k?nnen von Unbefugten verf?lscht oder unter 
fremden Namen erstellt werden.
Wir verwenden ein handels?bliches Viren-Schutzprogramm, dennoch k?nnen wir 
Computerviren und ?hnliches nicht ausschlie?en.
Diese E-Mail ist vertraulich und allein f?r den Gebrauch durch die vorgesehenen 
Empf?nger bestimmt.
Wenn Sie nicht der bestimmungsgem??e Empf?nger sind, l?schen Sie bitte die 
E-Mail.

[EFQM - Recognised for excellence 4 star - 2012]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users