[sqlite] Using sqlite3_backup* while the destination connection has "busy" read-only statements.

2014-11-12 Thread Shaun Seckman (Firaxis)
Greetings all, I'm running into a situation in where our application is crashing during a call to sqlite_backup_finish inside of btreeParseCellPtr because some of the structure is corrupted. Both the source and destination database are using the same page sizes and I'm running everything from

Re: [sqlite] Feature Request: Change busy error message

2012-05-23 Thread Shaun Seckman (Firaxis)
tements on the same connection. AFAIK, SQLITE_LOCKED implies that contention is from another connection using the same shared database cache. And it can be handled either via a busy handler just like SQLITE_BUSY or via sqlite3_unlock_notify(). Pavel On Wed, May 23, 2012 at 12:39 PM, Shaun

[sqlite] Feature Request: Change busy error message

2012-05-23 Thread Shaun Seckman (Firaxis)
connection only to just now realize the error code was indeed SQLITE_BUSY. Can we instead change the error message to read: SQLITE_BUSY -> "database is busy." SQLITE_LOCKED -> "database table is locked" -Shaun Shaun Seckman Firaxis Games Programmer __

[sqlite] Can an online backup happen during a nested transaction?

2010-05-11 Thread Shaun Seckman (Firaxis)
Hello, I'm attempting to save a backup of my in-memory database using the online backup routines. I noticed that I cannot seem to make backups of the database when there is a pending save point. The error code is SQLITE_BUSY. Is this the expected behavior? Are there any ways

Re: [sqlite] SQLite parsing of a .sql file

2010-04-09 Thread Shaun Seckman (Firaxis)
of a .sql file On 04/09/2010 01:25 PM, Shaun Seckman (Firaxis) wrote: > I'm running into a nasty problem towards the end of the file however. > At the very end there are 3 characters left that are just whitespace > characters. When I pass this string into sqlite3_prepare_v2() I get a >

Re: [sqlite] SQLite parsing of a .sql file

2010-04-09 Thread Shaun Seckman (Firaxis)
/length combination. Perhaps I missed something else in the documentation? -Shaun -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Shaun Seckman (Firaxis) Sent: Friday, April 09, 2010 3:37 PM To: General Discussion of SQLite

Re: [sqlite] SQLite parsing of a .sql file

2010-04-09 Thread Shaun Seckman (Firaxis)
, April 09, 2010 3:24 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite parsing of a .sql file On Apr 10, 2010, at 1:51 AM, Adam DeVita wrote: > Is this a 1 off import? If so, perhaps the command line tool > can .read it. > > On Fri, Apr 9, 2010 at 2:13 PM, S

Re: [sqlite] SQLite parsing of a .sql file

2010-04-09 Thread Shaun Seckman (Firaxis)
] On Behalf Of Adam DeVita Sent: Friday, April 09, 2010 2:52 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite parsing of a .sql file Is this a 1 off import? If so, perhaps the command line tool can .read it. On Fri, Apr 9, 2010 at 2:13 PM, Shaun Seckman (Firaxis) < shaun.s

[sqlite] SQLite parsing of a .sql file

2010-04-09 Thread Shaun Seckman (Firaxis)
Greetings, I've got a .SQL file that contains multiple SQL insert statements for various tables as well as comments embedded throughout. When I attempted to pass the file into sqlite3_exec, I found that only the first SQL command was getting executed. What is the best way to ensure that all

[sqlite] Feature Request: More descriptive error message to replace "Constraint Failed."

2009-11-30 Thread Shaun Seckman (Firaxis)
Hello everyone, I've recently stumbled across a plethora of "Constraint Failed" errors in my code due to a schema change that modified various columns of tables to be unique. It would be extremely useful if this error message could contain more information such as which

[sqlite] Verbosity of inner join queries

2009-11-16 Thread Shaun Seckman (Firaxis)
Hey guys, This may be more of a question about the SQL language itself rather than SQLite. I'm finding inner join statements to be more verbose than they should be and I'm curious if there is any sort of syntax sugar that can be done to shorten them. An Example:

[sqlite] Request: SQLITE_USE_MALLOCA

2009-11-10 Thread Shaun Seckman (Firaxis)
Hello all, SQLite currently has a SQLITE_USE_ALLOCA define in which it will attempt to use alloca instead of malloc when the usage fits. One of the common dangers with alloca is that if there is not enough stack space, bad things happen and it's usually very difficult to debug.

[sqlite] Ideal way to check whether a table has a specific column

2009-11-03 Thread Shaun Seckman (Firaxis)
the "name" column until I hit a match or I've finished stepping through the record set. Is there a better way? Shaun Seckman Firaxis Games Programmer ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-

Re: [sqlite] Roadmap for SQLite

2009-11-02 Thread Shaun Seckman (Firaxis)
To: General Discussion of SQLite Database Subject: Re: [sqlite] Roadmap for SQLite -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Shaun Seckman (Firaxis) wrote: > I'm really interested in finding out what sort of major features or > tweaks are planned to be in upcoming releases (within the

[sqlite] Roadmap for SQLite

2009-11-02 Thread Shaun Seckman (Firaxis)
Hello, Is there any sort of development road map for SQLite? I'm really interested in finding out what sort of major features or tweaks are planned to be in upcoming releases (within the next 6 months). The foreign key constraint feature came as a pleasant surprise but ended up

[sqlite] Table aliases

2009-10-09 Thread Shaun Seckman (Firaxis)
Happy Friday everyone! I've got several tables each representing a specific language which my application uses to access translated strings. It'd be extremely useful if I were able to alias a table as "CurrentLanguage" as opposed to directly referencing the actual name. This

Re: [sqlite] Database Diff libs or applications

2009-10-01 Thread Shaun Seckman (Firaxis)
) Is there a way around this? -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Shaun Seckman (Firaxis) Sent: Thursday, October 01, 2009 10:13 AM To: punk...@eidesis.org; General Discussion of SQLite Database Subject: Re

Re: [sqlite] Database Diff libs or applications

2009-10-01 Thread Shaun Seckman (Firaxis)
Sent: Thursday, October 01, 2009 10:03 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Database Diff libs or applications On Thu, Oct 1, 2009 at 8:44 AM, Shaun Seckman (Firaxis) <shaun.seck...@firaxis.com> wrote: > Hello, > >                I'm looking to e

Re: [sqlite] Database Diff libs or applications

2009-10-01 Thread Shaun Seckman (Firaxis)
what automated or custom solution you would use. On Thu, Oct 1, 2009 at 9:44 AM, Shaun Seckman (Firaxis) < shaun.seck...@firaxis.com> wrote: > Hello, > >I'm looking to externally track the actions made to a > database so that I can apply those same actions t

[sqlite] Database Diff libs or applications

2009-10-01 Thread Shaun Seckman (Firaxis)
Hello, I'm looking to externally track the actions made to a database so that I can apply those same actions to another database (assuming the other database has a similar schema). I've searched the documentation and there doesn't seem to be an easy way to extract this data so

Re: [sqlite] Most wanted features of SQLite ?

2009-09-21 Thread Shaun Seckman (Firaxis)
oking for is a form of NATURAL JOIN just..more natural :) -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik Sent: Monday, September 21, 2009 3:25 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Most wanted featu

Re: [sqlite] Most wanted features of SQLite ?

2009-09-21 Thread Shaun Seckman (Firaxis)
Here are my most wanted features and they don't even require locking or threading fu ;) * I really would like some SQL syntax sugar that will automatically include rows referenced by foreign keys in a table. I haven't seen any other SQL database do this as all expect you to explicitly

Re: [sqlite] Question on converting objects into relational db

2009-09-10 Thread Shaun Seckman (Firaxis)
You could either store the object as a blob in the database or if you had your own custom collection of these objects it's possible that you could create a virtual table that can be used as the glue between SQLite and this collection. -Shaun -Original Message- From:

Re: [sqlite] SQLite version 3.6.18 scheduled for Monday

2009-09-09 Thread Shaun Seckman (Firaxis)
of SQLite Database Subject: Re: [sqlite] SQLite version 3.6.18 scheduled for Monday On Sep 9, 2009, at 2:04 PM, Shaun Seckman (Firaxis) wrote: > It's always a pleasure to have a new version of one of my favorite > tools. I noticed in the draft that you migrated the project to > Fossi

Re: [sqlite] SQLite version 3.6.18 scheduled for Monday

2009-09-09 Thread Shaun Seckman (Firaxis)
It's always a pleasure to have a new version of one of my favorite tools. I noticed in the draft that you migrated the project to Fossil. I am curious, how was your experience with the migration? Did it go smoothly or were there many kinks to work out. Also, what was your primary motivation for

Re: [sqlite] how to get "One to many" in 1 row of a table ?

2009-09-09 Thread Shaun Seckman (Firaxis)
It seems like the more ideal solution would be to create a third table for ownership that contains a person ID and a vehicle ID. This will result in more tables (significantly more if you're trying to migrate object oriented data into a relational model) but is that really a bad thing? I

[sqlite] Booleans in SQLite

2009-09-02 Thread Shaun Seckman (Firaxis)
Hello everyone, I'm just curious how difficult it would be to add support for booleans in SQLite. This would most likely involve adding a new type affinity as well as adding "true" and "false" keywords to the lexer. There's much more that could be done but I'm just looking for

Re: [sqlite] can sqlite result be sorted by using "prepare-step" API

2009-08-24 Thread Shaun Seckman (Firaxis)
This is a side question to the topic, but is it possible to generate the prepared statement opcodes at compile-time and store them in some sort of data file instead of running through the lexical parser? It seems like for embedded tightly controlled systems where the database schema will rarely

Re: [sqlite] Reverse string comparison for searches

2009-08-21 Thread Shaun Seckman (Firaxis)
-boun...@sqlite.org] On Behalf Of Igor Tandetnik Sent: Friday, August 21, 2009 2:44 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Reverse string comparison for searches Shaun Seckman (Firaxis) <shaun.seck...@firaxis.com> wrote: >Currently, in my database I'm storing

Re: [sqlite] Reverse string comparison for searches

2009-08-21 Thread Shaun Seckman (Firaxis)
Discussion of SQLite Database Subject: Re: [sqlite] Reverse string comparison for searches On Fri, Aug 21, 2009 at 1:33 PM, Shaun Seckman (Firaxis)<shaun.seck...@firaxis.com> wrote: > Hello everyone, > >                Currently, in my database I'm storing thousands of > strings

[sqlite] Reverse string comparison for searches

2009-08-21 Thread Shaun Seckman (Firaxis)
Hello everyone, Currently, in my database I'm storing thousands of strings that are formatted in such a way where they share similar prefixes (i.e. TXT_KEY_FOO, TXT_KEY_BAR). Sadly, this format cannot be changed so I was wondering if it would be possible and perhaps faster to

[sqlite] Clarification of string pointer lifetime

2009-08-18 Thread Shaun Seckman (Firaxis)
Hey everyone, The documentation for sqlite3_column_text() states that the string returned will always be NULL and that the pointers are valid until sqlite3_step(), sqlite3_reset() or sqlite3_finalize() is called. Is this ONLY when the same prepared statement is used in those

Re: [sqlite] GUI design & managment tool?

2009-08-04 Thread Shaun Seckman (Firaxis)
I've tried many free tools as well as shareware tools. Here are my two favorites and why: SQLite Manager for Firefox, Thunderbird, etc: http://code.google.com/p/sqlite-manager/ This one is simply amazing! It does everything I want, supports multiple platforms and is completely free. It

[sqlite] Foreign Key constraint checking

2009-07-31 Thread Shaun Seckman (Firaxis)
Hello, I am well aware that SQLite doesn't enforce FK's and that a way around this is to use triggers. This lack of enforcing actually has worked to my advantage as when populating my database I can insert data out of order. However, after all data has been inserted into the database, I'd

[sqlite] inner joins on prepared statements

2009-07-28 Thread Shaun Seckman (Firaxis)
Hello All, Say I have the following prepared statement "select B.foo from A inner join B on A.bar = B.bar where A.foo = ?" used to populate values from a reference table. If I intend on executing this statement several times with different bound values, is it better for me to

[sqlite] Insert multiple entries in a single INSERT statement

2009-07-28 Thread Shaun Seckman (Firaxis)
Hello, Looking at the SQL syntax chart it doesn't seem like this is possible. In other SQL servers I'm able to use the statement "insert into foo('col1', col2') values ('1', '1'), ('2', '2'), ('3', '3');". Is this possible in SQLite or must I instead insert one at a time.

[sqlite] Performance tuning the Lookaside memory allocator

2009-07-27 Thread Shaun Seckman (Firaxis)
Hello, I'm in the process of tuning my allocators such that the fixed buffers will be enough to prevent any overflow from occuring. I've been using the memory statistics to tweak the page cache, and scratch buffers accordingly but found that there are no such mechanisms for

Re: [sqlite] Defining a table that starts rowid as 0

2009-07-23 Thread Shaun Seckman (Firaxis)
I currently have all my tables with a column called "ID" that is defined as Integer Primary Key. For legacy code purposes, I need ID to start at 0 and not at 1 however I'd like to have this be defined as part of the table schema and not as part of the insertion statement. I tried defining it as

[sqlite] Defining a table that starts rowid as 0

2009-07-23 Thread Shaun Seckman (Firaxis)
Hello, Is it possible in the create a table where the rowid will start at 0 instead of 1 prior to inserting a row and explicitly stating that the rowid is 0? -Shaun ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] Multiple connections to :memory: database

2009-07-21 Thread Shaun Seckman (Firaxis)
Is it possible to have multiple connections to a purely in-memory database and if so how can one go by doing that? Would it be safe if the connections were on separate threads? -Shaun ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] Type conversion performance

2009-07-02 Thread Shaun Seckman (Firaxis)
Consider the following SQL Statement: create table foo(val1 integer, val2 integer, val3 integer); insert into foo values('1', '2', '3'); When I call sqlite3_column_int(stmt, columnNum), must it convert the string to integer each time or will it perform that conversion on insertion? Is it

[sqlite] Anyway to set initial value of autoincrement primary key to 0?

2009-06-29 Thread Shaun Seckman (Firaxis)
Is there any way to set the initial value for an integer primary key auto-increment column to 0? Currently it always defaults to 1. -Shaun ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] SQL result to struct

2009-06-29 Thread Shaun Seckman (Firaxis)
I also wanted a similar functionality but in the end decided to use a prepared statement w/ sqlite3_column_* methods. My two main reasons were a) it didn't seem like there were any methods to dumping the data to a struct like that and b) I was able to do any sort of validation I desired such as

[sqlite] ROWID of 0

2009-06-26 Thread Shaun Seckman (Firaxis)
I have a column ("ID") in a table that is the primary key integer so it should be an alias for ROWID. Is it safe to have a ROWID of 0? -Shaun ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] Two simple questions

2009-06-24 Thread Shaun Seckman (Firaxis)
Just two quick and simple questions :) In a prepared statement, is there a quick way to determine what the index of a column with a specific name is or must I just iterate through all columns and perform a string comparison? How can I go by determining the

Re: [sqlite] Literal replacements in prepared statements

2009-06-19 Thread Shaun Seckman (Firaxis)
:06 AM, Shaun Seckman (Firaxis)<shaun.seck...@firaxis.com> wrote: > Not sure I fully understand what you mean.  Is it not possible to replace the > table name in the prepared statement?  What sort of things can I replace then? > > -Original Message- > From: sqlite-

Re: [sqlite] Literal replacements in prepared statements

2009-06-19 Thread Shaun Seckman (Firaxis)
:58 AM, Shaun Seckman (Firaxis)<shaun.seck...@firaxis.com> wrote: > I'm trying to add some literal replacements in my prepared SQL statement > but I'm currently getting a SQL syntax error. > > Here's a snippit of what I'm trying to do: > > > > ... > > sqlite3_s

[sqlite] Literal replacements in prepared statements

2009-06-19 Thread Shaun Seckman (Firaxis)
I'm trying to add some literal replacements in my prepared SQL statement but I'm currently getting a SQL syntax error. Here's a snippit of what I'm trying to do: ... sqlite3_stmt* stmt; sqlite3_prepare_v2(db, "Select * from ?", -1, , NULL); <-- near "?": syntax error

[sqlite] Duplicating an sqlite3_stmt

2009-06-18 Thread Shaun Seckman (Firaxis)
Is there any way to duplicate a sqlite3_stmt instance? I like being able to prepare and cache multiple statements but since the results are also tied into the statement structure, I'd like to be able to duplicate the statement to be used in another query. My only reasoning for doing this is to

[sqlite] Questions from a new user

2009-06-18 Thread Shaun Seckman (Firaxis)
per instance of a Query class. Also, what is the lifetime of the text received by sqlite3_column_text? -Shaun Shaun Seckman Firaxis Games Programmer ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman