Re: [sqlite] Re: SQLite and Java

2006-08-09 Thread Umesh Nayak

Thanks David,

I downloaded the JDBC driver written by you after going thru the
archives of mailing lists

Regards,

Umesh

On 8/10/06, David Crawshaw <[EMAIL PROTECTED]> wrote:

Umesh Nayak <[EMAIL PROTECTED]> wrote:
> Does SQLite work with Java?

Yes. I have written a JDBC driver for SQLite 3:

http://www.zentus.com/sqlitejdbc

There are also other projects for working with SQLite in Java. See the
wiki off www.sqlite.org

d



[sqlite] Re: SQLite and Java

2006-08-09 Thread David Crawshaw

Umesh Nayak <[EMAIL PROTECTED]> wrote:

Does SQLite work with Java?


Yes. I have written a JDBC driver for SQLite 3:

http://www.zentus.com/sqlitejdbc

There are also other projects for working with SQLite in Java. See the
wiki off www.sqlite.org

d


[sqlite] SQLite and Java

2006-08-09 Thread Umesh Nayak

Dear all,

Does SQLite work with Java?

Regards,

UmeshN


Re: [sqlite] Recovery tool ?

2006-08-09 Thread RohitPatel9999

Once I experienced a problem during testing where multi-threaded Win32
Application (using SQLite 3.3.4) was running (in development environment)
and due to power-failure, rollback journal file was OK but disk bad-sector
damaged the sqlite db-file. 

When I restarted App, db could not be opened (data file was probably
corrupted), So I tried to copy db-file to another place and it could not
copy (due to disk bad-sector). (I guess, at the time of power-failure, my
app may be writing to db-file (after rollback generation) exactly that same
moment of power failure, which caused bad sector in disk db-file and db-file
got corrupted, so could not be rolled back while opened for the next time).

I needed to get copy of db-file from previous night backup. (As hardware
failure (bad-sector), does not left us many choices).

Rohit

-- 
View this message in context: 
http://www.nabble.com/Recovery-tool---tf2071432.html#a5737892
Sent from the SQLite forum at Nabble.com.



Re: [sqlite] Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-09 Thread John Stanton
It depends upon your application.  For it to function optimally you 
should make each transaction on your application an SQL transaction, 
commit it on success or rollback if there is a problem.  In that way you 
make each transaction atomic and maintain the integrity of your database.


Since Sqlite locks the entire database when it is being modified, 
transactions which modify the database can be made exclusive.


RohitPatel wrote:

Thanks for clearing doubt.

Now question is...

While using SQLite dll Version 3.3.4 on Windows 
- Multiple threads/processes access SQLite database, 
- Each thread does some SELECTs, INSERTs or UPDATEs. 

Wrapping all read-only SELECEs with BEGIN TRANSACTION 
and using BEGIN EXCLUSIVE to wrap all UPDATEs or INSERTs (including their

related SELECTs),

Are their possibilities of writer starvation ? 
And if yes, what is the preferable solution ? (I mean what is the better

approach to handle that)

Thanks again.
Rohit





[sqlite] Re: Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-09 Thread Igor Tandetnik

RohitPatel 
wrote:

While using SQLite dll Version 3.3.4 on Windows
- Multiple threads/processes access SQLite database,
- Each thread does some SELECTs, INSERTs or UPDATEs.

Wrapping all read-only SELECEs with BEGIN TRANSACTION
and using BEGIN EXCLUSIVE to wrap all UPDATEs or INSERTs (including
their related SELECTs),

Are their possibilities of writer starvation ?



With big enough time-out set up, there should not be. In the process of 
acquiring EXCLUSIVE lock, SQLite first acquires PENDING lock which 
allows existing readers to proceed but does not allow any new readers 
in. Once all the readers clear, the writer acquires EXCLUSIVE lock and 
can begin writing.


Igor Tandetnik



Re: [sqlite] Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-09 Thread RohitPatel9999

Thanks for clearing doubt.

Now question is...

While using SQLite dll Version 3.3.4 on Windows 
- Multiple threads/processes access SQLite database, 
- Each thread does some SELECTs, INSERTs or UPDATEs. 

Wrapping all read-only SELECEs with BEGIN TRANSACTION 
and using BEGIN EXCLUSIVE to wrap all UPDATEs or INSERTs (including their
related SELECTs),

Are their possibilities of writer starvation ? 
And if yes, what is the preferable solution ? (I mean what is the better
approach to handle that)

Thanks again.
Rohit

-- 
View this message in context: 
http://www.nabble.com/Multiple-SELECTs-%28and-single-SELECT%29-and-TRANSACTION---tf2072083.html#a5737733
Sent from the SQLite forum at Nabble.com.



[sqlite] Re: Foreign Keys

2006-08-09 Thread A. Pagaltzis
* John Newby <[EMAIL PROTECTED]> [2006-08-10 00:25]:
> it recognises them if you put them in your create table
> statement but it does not enforce them, is this correct?

Yes. But note that you can retrofit enforcement yourself. Take a
look at

Enforce Foreign Key Integrity in SQLite with Triggers

http://www.justatheory.com/computers/databases/sqlite/foreign_key_triggers.html

Regards,
-- 
Aristotle Pagaltzis // 


Re: [sqlite] Foreign Keys

2006-08-09 Thread John Stanton
Parsing is a language term.  You might recall being taught to parse a 
sentence into subject and predicate, then phrases, verbs nouns, articles 
etc.  A computer language parser does the same thing, lexical analysis 
to extract the words and syntactical analysis to match to the grammar.


That apparently is as far as Sqlite goes with foreign keys.

John Newby wrote:

FOREIGN KEY constraints are parsed but are not enforced.

Hi, what does the above statement on the SQLite website mean?

Call me stupid but I do not understand the word "parsed", I was thinking it
meant, it recognises them if you put them in your create table statement 
but

it does not enforce them, is this correct?

I looked it up in a dictionary but it confused me more, this is what it 
said

for the word parsed :-

1. To break (a sentence) down into its component parts of speech with an
explanation of the form, function, and syntactical relationship of each
part.
2. To describe (a word) by stating its part of speech, form, and 
syntactical

relationships in a sentence.
3.
  a. To examine closely or subject to detailed analysis, especially by
breaking up into components: "What are we missing by parsing the 
behavior of
chimpanzees into the conventional categories recognized largely from our 
own

behavior?" (Stephen Jay Gould).
  b. To make sense of; comprehend: I simply couldn't parse what you just
said.
4. Computer Science. To analyze or separate (input, for example) into more
easily processed components.





RE: [sqlite] Second Btree Transaction stuck at commit

2006-08-09 Thread William Chan
Thanks Richard.  I need btree indexing in a commercial project and looks
like everybody is charging fee... and it wouldn't be a problem if I am the
guy who is writing the check...  I just did some simple stress test
(inserting and query a million records) and you guys save my behind.  

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 09, 2006 7:09 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Second Btree Transaction stuck at commit

"William Chan" <[EMAIL PROTECTED]> wrote:
> Hi Guys,
> 
> I think I figure out my problem.  Looks like I need to close the cursor
and
> create a new cursor between the two Btree transactions.  Then the second
> btree commit will go thru.  Can someone explain to me why?  Thanks.
> 

Before you go too far with this Btree project, you do understand
the terms of use, right?

   *  The BTree interface is an internal interface and is
  not documented or supported.

   *  The BTree interface is only tested in ways that are
  used by the SQL layer and will likely break if you use 
  it differently.

   *  The BTree interface is not intended for external use
  and therefore likely to have many undocumented
  quirks and idiosynchrasies.

   *  The BTree interface has changed without notice in the
  past and will likely change again without notice in 
  the future.

--
D. Richard Hipp   <[EMAIL PROTECTED]>





Re: [sqlite] Second Btree Transaction stuck at commit

2006-08-09 Thread drh
"William Chan" <[EMAIL PROTECTED]> wrote:
> Hi Guys,
> 
> I think I figure out my problem.  Looks like I need to close the cursor and
> create a new cursor between the two Btree transactions.  Then the second
> btree commit will go thru.  Can someone explain to me why?  Thanks.
> 

Before you go too far with this Btree project, you do understand
the terms of use, right?

   *  The BTree interface is an internal interface and is
  not documented or supported.

   *  The BTree interface is only tested in ways that are
  used by the SQL layer and will likely break if you use 
  it differently.

   *  The BTree interface is not intended for external use
  and therefore likely to have many undocumented
  quirks and idiosynchrasies.

   *  The BTree interface has changed without notice in the
  past and will likely change again without notice in 
  the future.

--
D. Richard Hipp   <[EMAIL PROTECTED]>



RE: [sqlite] Second Btree Transaction stuck at commit

2006-08-09 Thread William Chan
Hi Guys,

I think I figure out my problem.  Looks like I need to close the cursor and
create a new cursor between the two Btree transactions.  Then the second
btree commit will go thru.  Can someone explain to me why?  Thanks.

Regards,
William

-Original Message-
From: William Chan [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 09, 2006 5:47 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] Second Btree Transaction stuck at commit 

Hi,

 

I wrote a test program for the Sqlite btree functions.  First I start a
btree transaction to create the table and insert a few record then I commit
the btree transaction, after that I try to start btree transaction to delete
some record.  Everything returns successful until I try to commit the 2nd
transaction.  It just stuck there.  Anything I did wrong.  As long as I
don't commit the second time, things are running.  Any suggestion would be
appreciated .  Thank you for your help.

 

Regards,

William





Re: [sqlite] Foreign Keys

2006-08-09 Thread Stefan de Konink
Probably it should be read as:

Sqlite recognizes 'references' as SQL92(?) but does not do anything with
it. Eq. you can have ids that totally not match.


Stefan de Konink



[sqlite] Foreign Keys

2006-08-09 Thread John Newby

FOREIGN KEY constraints are parsed but are not enforced.

Hi, what does the above statement on the SQLite website mean?

Call me stupid but I do not understand the word "parsed", I was thinking it
meant, it recognises them if you put them in your create table statement but
it does not enforce them, is this correct?

I looked it up in a dictionary but it confused me more, this is what it said
for the word parsed :-

1. To break (a sentence) down into its component parts of speech with an
explanation of the form, function, and syntactical relationship of each
part.
2. To describe (a word) by stating its part of speech, form, and syntactical
relationships in a sentence.
3.
  a. To examine closely or subject to detailed analysis, especially by
breaking up into components: "What are we missing by parsing the behavior of
chimpanzees into the conventional categories recognized largely from our own
behavior?" (Stephen Jay Gould).
  b. To make sense of; comprehend: I simply couldn't parse what you just
said.
4. Computer Science. To analyze or separate (input, for example) into more
easily processed components.


[sqlite] Second Btree Transaction stuck at commit

2006-08-09 Thread William Chan
Hi,

 

I wrote a test program for the Sqlite btree functions.  First I start a
btree transaction to create the table and insert a few record then I commit
the btree transaction, after that I try to start btree transaction to delete
some record.  Everything returns successful until I try to commit the 2nd
transaction.  It just stuck there.  Anything I did wrong.  As long as I
don't commit the second time, things are running.  Any suggestion would be
appreciated .  Thank you for your help.

 

Regards,

William



Re: [sqlite] Query Execution speed.

2006-08-09 Thread Kees Nuyt
On Wed, 9 Aug 2006 18:51:30 +0600, you wrote:

>hi All,
>
>I have to use SQLite for one of my project as ":memory:" db.

[snip]

>which PRAGMA statements can improve the query speed. 
>the main queries are, INSERT and SELECT with joins.
>
>I have just tried the following PRAGMA
>
>sqlite3_exec(db, "PRAGMA temp_store=2", NULL, NULL, NULL);
>   sqlite3_exec(db, "PRAGMA synchronous=0", NULL, NULL, NULL);
>   sqlite3_exec(db, "PRAGMA count_changes=OFF", NULL, NULL, NULL);
>   sqlite3_exec(db, "pragma default_cache_size =65536", NULL, NULL,NULL);

That seems Ok to me.

>   sqlite3_exec(db, "pragma cache_size = 8192", NULL, NULL, NULL); 

That is weird, why would you set a large default_cache_size but
a much smaller cache_size for the current connection?
For a memory database that wouldn't make any difference though.

>can someone guide me which PRAGMA statements are useful for 
>speed improvement and what values I need to set for those.
>like  "pragma default_cache_size =?"

It might help to PRAGMA the page_size as well. You have only one
chance to do that: at databasefile creation time, just before
you CREATE your first table, and it should reflect the optimal
size for your platform. On windows, it should be the same as the
actual cluster size of your filesystem.
For a memory database that wouldn't make much difference.

>I have a 4G Physical Memory.

That's a lot to play with.

>//-- 
>one last thing, I have tested the code written by "Dennis Cote"
>Wed, 03 May 2006 " performance v2 and V3 "
>
>I found that Version 2.8 was much Faster than 3.6 using ":memory:", 30 
>Seconds and 60 seconds in case of 2.8 and 3.6 respectively.
>can I use 2.8 in my project when i have a huge amount of data to handle.
>
>Thanks 
>Regards,
>
>Manzoor Ilahi Tamimy

The biggest gain will be in your database structure and
handling:
- optimize your schema
- don't store anything you don't really need
- define indexes for every column you will join on
- be very critical on your joins
- experiment with table order in joins
- sometimes a union of two or more inner joins 
  is better than one outer join
- experiment
- read the page about index usage
- use EXPLAIN

Many of these techniques are discussed on the sqlite site, it
really pays off to try to read all of it.
-- 
  (  Kees Nuyt
  )
c[_]


[sqlite] SQLite BCB3

2006-08-09 Thread JJ Thymes

Hey yall, i'm trying to use SQLite3 with Borland C++ Builder 3.0
Professional.  To setup SQLite I used Remy Lebeau's instructions as
listed here

http://groups.google.com/group/borland.public.cppbuilder.students/browse_thread/thread/967c6ccd741835a9/a6a6ec014fb158ea?lnk=st&q=&rnum=1&hl=en#a6a6ec014fb158ea

1) File > New > Library
2) Add all of the .c files from the SQLLite source into the library (except
the shell.c and tclsqlite.c files)
3) Build the library
4) add the compiled .lib file to your main project
5) #include the sqlite.h header file

I did this and it works fine with a console application using the VCL.

Unfortunately it does not work with a windows application.

Does anyone have a clue why???

Code:
void __fastcall TfrmMain::Button1Click(TObject *Sender) {
char *zErrMsg, **result;
char buffer[80];
int rc, fcnt, rcnt;
sqlite3 *db;

  rc = sqlite3_open("Test01.db", &db);
  if (rc != SQLITE_OK) {
 txtMessage->Text = "Could not open database!";
 return;
  }//end if

  strcpy(buffer, "create table tblTest (testID integer)");

  rc = sqlite3_get_table(db, buffer, &result, &rcnt, &fcnt, &zErrMsg);

  if (rc != SQLITE_OK) {
 txtMessage->Text = zErrMsg;
 sqlite3_free(zErrMsg);
  } else {
 txtMessage->Text = "Success!";
  }//end if
  sqlite3_free_table(result);
}

Error Message:
malformed database schema - near "BLE": syntax error


TIA,
JJ


Re: [sqlite] Query Execution speed.

2006-08-09 Thread Jens Miltner


Am 09.08.2006 um 05:51 schrieb Manzoor Ilahi Tamimy:


hi All,

I have to use SQLite for one of my project as ":memory:" db.

// 


-
Can I get a better speed if I change or omit some macros.
I saw  " http://www.sqlite.org/compile.html ". the macros defined  
here can
only resulting in a smaller compiled library size or they can also  
improve

some speed?

we can also Override these macros through PRAGMA statements.
Is there any difference between when we handle these macros  
directly or

override through PRAGMA.

which PRAGMA statements can improve the query speed.
the main queries are, INSERT and SELECT with joins.

I have just tried the following PRAGMA

sqlite3_exec(db, "PRAGMA temp_store=2", NULL, NULL, NULL);
sqlite3_exec(db, "PRAGMA synchronous=0", NULL, NULL, NULL);
sqlite3_exec(db, "PRAGMA count_changes=OFF", NULL, NULL, NULL);
	sqlite3_exec(db, "pragma default_cache_size =65536", NULL,  
NULL,NULL);

sqlite3_exec(db, "pragma cache_size = 8192", NULL, NULL, NULL);

can someone guide me which PRAGMA statements are useful for speed  
improvement

and what values I need to set for those.
like  "pragma default_cache_size =?"

I have a 4G Physical Memory.
// 


-


You don't tell us anything about the query you're going to run. Most  
optimizations can actually be done to the query itself or to your  
database schema (e.g. by building the appropriate indices). Anything  
you'll get through compilation will probably only get you minor  
improvements really.
Of course, you can check which features you don't need and leave them  
out at compile time, hoping that this will give you some performance  
boost, but I don't think you'll see a 2x improvement by doing this  
kind of change. I'd really go in first and try to optimize/rewrite  
the queries for sqlite first and see if there's some performance gain  
in there for you. I've seen query speed improve by a factor of 10 or  
more when using the right indexes or rewriting the query such that it  
can in fact use the one index I thought it would use in the first place.
If you already have indexes you think the query uses, verify it does  
indeed use the index by running your query prefixed with "EXPLAIN  
QUERY PLAN".
I think a while ago somebody posted some rules of thumb of what will  
make queries run fast in sqlite and what to avoid. I can't remember  
the title, but I'm sure if you search for threads containing  
"peformance" or "speed" you'll find it in the archives. It's hard to  
tell what might make your query run faster without knowing your query.



one last thing, I have tested the code written by "Dennis Cote"
Wed, 03 May 2006 " performance v2 and V3 "

I found that Version 2.8 was much Faster than 3.6 using ":memory:", 30
Seconds and 60 seconds in case of 2.8 and 3.6 respectively.
can I use 2.8 in my project when i have a huge amount of data to  
handle.


Of course you can use 2.8 - just link against the 2.8 libraries. You  
can even use both 2.8 and 3.x together, since they have distinct APIs  
whose names don't conflict, but remember that the 2.8 and 3.x  
databases can't be exchanged - the database format has changed. So  
you'll have to work on 2.8 databases using the 2.8 APIs and use 3.x  
APIs for a 3.x database.


HTH,





[sqlite] Query Execution speed.

2006-08-09 Thread Manzoor Ilahi Tamimy
hi All,

I have to use SQLite for one of my project as ":memory:" db.

//
-
Can I get a better speed if I change or omit some macros. 
I saw  " http://www.sqlite.org/compile.html ". the macros defined here can 
only resulting in a smaller compiled library size or they can also improve 
some speed?

we can also Override these macros through PRAGMA statements.
Is there any difference between when we handle these macros directly or 
override through PRAGMA.

which PRAGMA statements can improve the query speed. 
the main queries are, INSERT and SELECT with joins.

I have just tried the following PRAGMA

sqlite3_exec(db, "PRAGMA temp_store=2", NULL, NULL, NULL);
sqlite3_exec(db, "PRAGMA synchronous=0", NULL, NULL, NULL);
sqlite3_exec(db, "PRAGMA count_changes=OFF", NULL, NULL, NULL);
sqlite3_exec(db, "pragma default_cache_size =65536", NULL, NULL,NULL);
sqlite3_exec(db, "pragma cache_size = 8192", NULL, NULL, NULL); 

can someone guide me which PRAGMA statements are useful for speed improvement 
and what values I need to set for those.
like  "pragma default_cache_size =?"

I have a 4G Physical Memory.
//
-
one last thing, I have tested the code written by "Dennis Cote"
Wed, 03 May 2006 " performance v2 and V3 "

I found that Version 2.8 was much Faster than 3.6 using ":memory:", 30 
Seconds and 60 seconds in case of 2.8 and 3.6 respectively.
can I use 2.8 in my project when i have a huge amount of data to handle.

Thanks 
Regards,

Manzoor Ilahi Tamimy



Re: [sqlite] C precompiler to bytecode

2006-08-09 Thread drh
Christian Smith <[EMAIL PROTECTED]> wrote:
> 
> 
> Run time compilation is not that expensive if the generated vm is cached. 
> Just have a per-connection hash, use the SQL as the hash key, and the 
> resulltingvm as the value. Upon first use, the SQL will not be in the 
> hash, and will be compiled and inserted. Subsequent uses of the same SQL 
> will be quickly retrieved from the hash and used as is.
> 
> This is how the TCL wrappers work, I believe.
> 

Yes, this is how the TCL wrapper works.  But there are
some complications.

  (1)  It is important to limit the cache size.  Otherwise
   the size of the cache might grow without bound.  The
   TCL extension caches the last 10 statements by 
   default (the cache size can be adjusted at runtime).
   The cache employs LRU replacement.

  (2)  For any precompiled and cached statement, your code
   needs to be ready to deal with an SQLITE_SCHEMA error
   by deleting the old statement and rebuilding it using
   sqlite3_prepare().  An SQLITE_SCHEMA error occurs
   when the precompiled statement detects that the current
   database schema is different from the schema at the
   time the statement was first compiled.  The TCL
   wrapper handles SQLITE_SCHEMA errors automatically so
   that a TCL programmer never has to know about them.

The second point is the primary reason why Daniel's
original idea of precompiling statements in C++ programs
might not be as helpful as he imagines.  If statements
were precompiled into the C++ program, then the C++
program would have to be recompiled whenever the database
schema changed, which could quickly get to be bothersome.

As Joe Wilson pointed out, I sell a proprietary version
of SQLite that does something like what Daniel suggests.
The proprietary version omits the SQL parser and code
generator and is thus much smaller than the standard
SQLite - as small 65KiB.  There is currently just one
user of this extension - a manufacturer who puts the
code on smart-cards with extremely tight code memory 
constraints.  Another consumer device manufacturer is
also looking into this technology.

Using the proprietary extension, statements are prepared 
on a workstation and then the compiled forms of the 
statements are stored in a special table in the database.
The database is then transfered to the device.  The device
has just enough code to read the special table, extract
the prepared statements, and run the prepared statements.
You can also bind values the prepared statements so that
INSERT, and UPDATE statements are useful.  Note, however,
that the device is unable to modify the database schema in
any way, because if it were to do so, all of the precompiled
statements would have to be compiled again, and the device
lacks the SQL parser and code generator needed to do that.
So this extension, while useful in certain niche applications, 
is not particularly helpful to most people.

--
D. Richard Hipp   <[EMAIL PROTECTED]>




Re: [sqlite] Announce: SQL Maestro Group SQLite tools introduction

2006-08-09 Thread Trevor Talbot

On 8/9/06, Me <[EMAIL PROTECTED]> wrote:

Hi Maestro Group,

>NOT linked with SQLight team

I guess that's a dig on me.


I took that to mean that since there was a complaint about the
frequency of announcements, they didn't want to be mistaken for you
making another announcement on the same day.

Personally I'm with the poster upthread; they aren't THAT bad, and
both of you were kind enough to tag the subject line for easy
filtering anyway.


Re: [sqlite] C precompiler to bytecode

2006-08-09 Thread John Stanton
Daniel's concept is that of Embedded SQL, a marriage not quite made in 
heaven probably because of the clumsiness in integrating the database 
schema and the data definitions of legacy languages.


At one time we built a byte-coded implementation of a legacy language 
which did exactly as Daniel proposes, compiled the embedded SQL into the 
equivalent of the Sqlite VBDE and executed that at runtime.  It realized 
the benefits Daniel predicts.  The benefits were more evident back in an 
area of far slower machines than you would see today.


Christian Smith wrote:

Daniel Önnerby uttered:


Hi everyone!

I'm just a bit curios if it would be possible to make like a C 
precompiler or a macro of some kind that compiles/interpret the 
SQL-statements to bytecode just like the sqlite_prepare does but does 
this when compiling/precompiling your application instead of at 
runtime. Since most application written in C/C++ use static 
SQL-statements (unless you are building your SQL-strings on the fly) 
and then bind the values, I guess there would be several benefits for 
your compiled application:

* Faster: Since the SQL-statement is already interpreted.
* Smaller (not that sqlite needs to be smaller): The executable does 
not need to contain the part of sqlite that interprets the 
SQL-statements since this was made at compile time.





Run time compilation is not that expensive if the generated vm is 
cached. Just have a per-connection hash, use the SQL as the hash key, 
and the resulltingvm as the value. Upon first use, the SQL will not be 
in the hash, and will be compiled and inserted. Subsequent uses of the 
same SQL will be quickly retrieved from the hash and used as is.


This is how the TCL wrappers work, I believe.




Just a thought :)

Best regards
Daniel Önnerby



--
/"\
\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
 X   - AGAINST MS ATTACHMENTS
/ \




Re: [sqlite] Announce: SQL Maestro Group SQLite tools introduction

2006-08-09 Thread Me

Hi Maestro Group,


NOT linked with SQLight team


I guess that's a dig on me.
They were FREE little tools I had laying around.
Thought someone might get some use out of them.
They won't know if I don't tell them.

StanD
http://www.sqlight.com/
IS linked with SQLight team. :)
Lots of free SQLite tools.

- Original Message - > Hi All,


Two small notes first:

1. SQL Maestro Group is NOT linked with SQLight team, which messages you 
could read here last days.
2. It's our first announce and we promise to community to NOT send such 
messages too often - unfortunately, we don't release a new version every 
day. :-)


Best Regards,
SQL Maestro Group Team
http://www.sqlmaestro.com 





Re: [sqlite] Announce: SQL Maestro Group SQLite tools introduction

2006-08-09 Thread John Stanton

SQL Maestro Team wrote:

Hi All,

Two small notes first:

1. SQL Maestro Group is NOT linked with SQLight team, which messages you 
could read here last days.
2. It's our first announce and we promise to community to NOT send such 
messages too often - unfortunately, we don't release a new version every 
day. :-)


Let's continue. So the SQL Maestro Group is happy to introduce to you 
two new tools for the SQLite server.

http://www.sqlmaestro.com/products/sqlite/

The first product named SQLite Maestro. It is a software for efficient 
SQLite management, control and development, i.e. creating, editing, 
copying, extracting and dropping all the database objects, building 
queries visually, executing queries and SQL scripts, viewing and editing 
data (including BLOBs), representing data as diagrams, exporting and 
importing data to/from most popular file formats, etc. The main features 
of this product are as follows:


- Support of SQLite 2.8/3.3.6, including latest features such as check 
constraints and ASC/DESC indexes.
- Possibility of creating and editing of all schema objects, which is 
implemented as a number of convenient wizards and non-modal editors.
- Conception of database profiles gives you the opportunity to connect 
to databases in one touch and work with the selected databases only.
- SQL Editor with syntax highlighting, code completion and executing 
several queries at a time in separate threads.

- Visual Query Builder with SQL parser.
- Some other useful tools such as SQL Script Editor, BLOB Viewer/Editor, 
Diagram Viewer, Extract Database Wizard, etc.
- and much more. Non-commercial license costs as low as $49. Fully 
functional 30-day evaluation version is available at

http://www.sqlmaestro.com/products/sqlite/maestro/downloads/

The second software is SQLite Data Wizard. 
(http://www.sqlmaestro.com/products/sqlite/datawizard/) It is a utility, 
which provides you with a number of easy-to-use wizards for performing 
the required data manipulation easily and quickly. Currently SQLite Data 
Wizard includes the following features:


- PHP Generator Wizard: a powerful tool for generating PHP scripts from 
SQLite tables and queries. PHP Generator admits full customization of 
the resulting HTML appearance, customization of the resulting script, 
protection of your scripts with optional security settings.
- Data Pump Wizard: allows you to transfer databases (both structure and 
data) from such sources as Microsoft SQL Server or MS Access to your 
SQLite database.
- Data Export Wizard: powerful tools for exporting data from SQLite 
tables and queries to most popular formats (MS Excel, MS Access, MS 
Word, HTML, XML, PDF) are at your disposal.
- Data Import Wizard: you can import data from MS Excel, MS Access, XML, 
DBF, TXT, CSV formats to your SQLite database.
- Task Scheduler: one of the distinguishing features of SQLite Data 
Wizard consists in the ability to schedule tasks for executing them 
(once or periodically) later. A scheduled task starts a wizard with its 
template and does not require any actions from the user during execution.
- Of course you can also try this software without any trial 
limitations. Feel free to download an evaluation version at

http://www.sqlmaestro.com/products/sqlite/datawizard/download/

Hope you will like our products.
Sorry for such long message and thank you very much for your attention 
and patience.


Best Regards,
SQL Maestro Group Team
http://www.sqlmaestro.com
To Maestros and others.  Please announce your new work as often as you 
choose and continue to share it with others.  We are all the better for it.


Re: [sqlite] C precompiler to bytecode

2006-08-09 Thread Trevor Talbot

On 8/8/06, Nuno Lucas <[EMAIL PROTECTED]> wrote:


On 8/8/06, Daniel Önnerby <[EMAIL PROTECTED]> wrote:
> I'm just a bit curios if it would be possible to make like a C
> precompiler or a macro of some kind that compiles/interpret the
> SQL-statements to bytecode just like the sqlite_prepare does but does
> this when compiling/precompiling your application instead of at runtime.
> Since most application written in C/C++ use static SQL-statements
> (unless you are building your SQL-strings on the fly) and then bind the
> values, I guess there would be several benefits for your compiled
> application:



Now the cons:



 * Forget about using your program concurrently with others.
   Future sqlite versions may decide to use different low-level
implementations that
   can clash with your hardcoded functions (this is the same as
statically linking
   the sqlite library with your application).


This is an issue for the on-disk file format.  Static vs dynamic
linking and the sqlite versions used have no bearing here.


Re: [sqlite] C precompiler to bytecode

2006-08-09 Thread Christian Smith

Daniel Önnerby uttered:


Hi everyone!

I'm just a bit curios if it would be possible to make like a C precompiler or 
a macro of some kind that compiles/interpret the SQL-statements to bytecode 
just like the sqlite_prepare does but does this when compiling/precompiling 
your application instead of at runtime. Since most application written in 
C/C++ use static SQL-statements (unless you are building your SQL-strings on 
the fly) and then bind the values, I guess there would be several benefits 
for your compiled application:

* Faster: Since the SQL-statement is already interpreted.
* Smaller (not that sqlite needs to be smaller): The executable does not need 
to contain the part of sqlite that interprets the SQL-statements since this 
was made at compile time.




Run time compilation is not that expensive if the generated vm is cached. 
Just have a per-connection hash, use the SQL as the hash key, and the 
resulltingvm as the value. Upon first use, the SQL will not be in the 
hash, and will be compiled and inserted. Subsequent uses of the same SQL 
will be quickly retrieved from the hash and used as is.


This is how the TCL wrappers work, I believe.




Just a thought :)

Best regards
Daniel Önnerby



--
/"\
\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
 X   - AGAINST MS ATTACHMENTS
/ \

[sqlite] Announce: SQL Maestro Group SQLite tools introduction

2006-08-09 Thread SQL Maestro Team

Hi All,

Two small notes first:

1. SQL Maestro Group is NOT linked with SQLight team, which messages you 
could read here last days.
2. It's our first announce and we promise to community to NOT send such 
messages too often - unfortunately, we don't release a new version every 
day. :-)


Let's continue. So the SQL Maestro Group is happy to introduce to you two 
new tools for the SQLite server.

http://www.sqlmaestro.com/products/sqlite/

The first product named SQLite Maestro. It is a software for efficient 
SQLite management, control and development, i.e. creating, editing, copying, 
extracting and dropping all the database objects, building queries visually, 
executing queries and SQL scripts, viewing and editing data (including 
BLOBs), representing data as diagrams, exporting and importing data to/from 
most popular file formats, etc. The main features of this product are as 
follows:


- Support of SQLite 2.8/3.3.6, including latest features such as check 
constraints and ASC/DESC indexes.
- Possibility of creating and editing of all schema objects, which is 
implemented as a number of convenient wizards and non-modal editors.
- Conception of database profiles gives you the opportunity to connect to 
databases in one touch and work with the selected databases only.
- SQL Editor with syntax highlighting, code completion and executing several 
queries at a time in separate threads.

- Visual Query Builder with SQL parser.
- Some other useful tools such as SQL Script Editor, BLOB Viewer/Editor, 
Diagram Viewer, Extract Database Wizard, etc.
- and much more. Non-commercial license costs as low as $49. Fully 
functional 30-day evaluation version is available at

http://www.sqlmaestro.com/products/sqlite/maestro/downloads/

The second software is SQLite Data Wizard. 
(http://www.sqlmaestro.com/products/sqlite/datawizard/) It is a utility, 
which provides you with a number of easy-to-use wizards for performing the 
required data manipulation easily and quickly. Currently SQLite Data Wizard 
includes the following features:


- PHP Generator Wizard: a powerful tool for generating PHP scripts from 
SQLite tables and queries. PHP Generator admits full customization of the 
resulting HTML appearance, customization of the resulting script, protection 
of your scripts with optional security settings.
- Data Pump Wizard: allows you to transfer databases (both structure and 
data) from such sources as Microsoft SQL Server or MS Access to your SQLite 
database.
- Data Export Wizard: powerful tools for exporting data from SQLite tables 
and queries to most popular formats (MS Excel, MS Access, MS Word, HTML, 
XML, PDF) are at your disposal.
- Data Import Wizard: you can import data from MS Excel, MS Access, XML, 
DBF, TXT, CSV formats to your SQLite database.
- Task Scheduler: one of the distinguishing features of SQLite Data Wizard 
consists in the ability to schedule tasks for executing them (once or 
periodically) later. A scheduled task starts a wizard with its template and 
does not require any actions from the user during execution.
- Of course you can also try this software without any trial limitations. 
Feel free to download an evaluation version at

http://www.sqlmaestro.com/products/sqlite/datawizard/download/

Hope you will like our products.
Sorry for such long message and thank you very much for your attention and 
patience.


Best Regards,
SQL Maestro Group Team
http://www.sqlmaestro.com 



Re: [sqlite] Grabbing "default values" from the database...

2006-08-09 Thread Me

The value has to be NULL for the default value to fire.

If it's an empty string, "", that's what you'll get.



StanD.

- Original Message - 
Subject: [sqlite] Grabbing "default values" from the database...




I'm working on a project in C# that uses an SQLite database back-end.

I have a table set up so that some columns have default values, such as:

CREATE TABLE mc_question (id integer primary key autoincrement, q_type
varchar(5) default "MC", single_multi bool, negative_score
bool, cumulative_all bool, title_text varchar(200), question_format
bool, question varchar(200), image_file varchar(200), ans_order
bool, indices bool, ans_layout bool, feedback varchar(200), category_id
integer);

The "q_type" column is of type varchar(5) and has a default value of "MC".

I'm using DataGridView Controls which are bound to different BindingSource
objects, and I would like to populate the DataGridView columns with the
default values that are set within the database itself, so that I don't 
have

to set each column manually...

Does anyone know how I would do this?  If not, could someone tell me how 
to

grab the "default values" from the database? (I thought that FillSchema
would do it, but it doesn't)

Sincerely,

Gordon E.

P.S. I have asked in a MS ADO .NET forum, but they're no help.  They just
keep telling me I should set all the columns' default values manually... 
but

that's such a pain in the .