RE: [sqlite] Re: another

2007-02-14 Thread Samuel R. Neff
Personally, I think the column names given to a result set from a SELECT by itself should be the same column names given to a table created through CREATE TABLE AS. For example, the following sql: .headers on create table a(col1 text, col text); create table b(col2 text, col text); insert into a(

RE: [sqlite] Triggers+callbacks = GUI?

2007-02-15 Thread Samuel R. Neff
Personally I think a database should provide long-term storage for your application's state, not drive the application's UI. If you need to update views based on state then that state should be in memory with mechanisms to easily detect changes. If you're too far along and need to use the databa

RE: [sqlite] SELECT DISTINCT but ignore one column?

2007-02-15 Thread Samuel R. Neff
You could do this with a group by and use a min or max aggregate function on the "ignored" column HTH, Sam --- We're Hiring! Seeking a passionate developer to join our team products. Position is in the Washington D.C. metro area. If interested contact

RE: [sqlite] Re: SQL query - TOP

2007-02-16 Thread Samuel R. Neff
I for one would love to see SQLite support TOP as well as LIMIT (internally it can just translate TOP to LIMIT). It would greatly help in situations where we want to support multiple database engines in an application. Shouldn't be a huge addition to the size of the engine either... :-) Thank

[sqlite] PRAGMA temp_store -- is there a default_temp_store?

2007-02-26 Thread Samuel R. Neff
The SQLite optimization faq [1] mentions a PRAGMA default_temp_store which should set temp_store on a per-database level. However this doesn't seem to be correct--the official docs [2] don't mention default_temp_store and calling "PRAGMA default_temp_store;" always returns nothing (although calli

RE: [sqlite] How fast is the sqlite connection created?

2007-02-26 Thread Samuel R. Neff
Martin, Thank you for the testing and information. We're just starting to use SQLite and are using SQLite.NET. This library doesn't support connection pooling and we've been discussing whether to implement connection pooling external to the library. Your post certainly makes it look worthwhile.

RE: [sqlite] How fast is the sqlite connection created?

2007-02-26 Thread Samuel R. Neff
ition is in the Washington D.C. metro area. If interested contact [EMAIL PROTECTED] -Original Message- From: Martin Jenkins [mailto:[EMAIL PROTECTED] Sent: Monday, February 26, 2007 12:53 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] How fast is the sqlite connection created? Samue

RE: [sqlite] How fast is the sqlite connection created?

2007-02-28 Thread Samuel R. Neff
iring! Seeking a passionate developer to join our team building products. Position is in the Washington D.C. metro area. If interested contact [EMAIL PROTECTED] -Original Message- From: Samuel R. Neff [mailto:[EMAIL PROTECTED] Sent: Monday, February 26, 2007 11:58 PM To: 'sqlite-users@

[sqlite] String concatenation disallowed within a RAISE function?

2007-02-28 Thread Samuel R. Neff
It seems I can't use string concatenation within a RAISE call. This code: SELECT RAISE(ROLLBACK, 'test'); Works fine but this code SELECT RAISE(ROLLBACK, 'test' || 'ing'); Gives an error SQL error: near "||": syntax error Is this correct behavior? I found a work-arou

RE: [sqlite] How fast is the sqlite connection created?

2007-02-28 Thread Samuel R. Neff
One last set of performance numbers for opening a connection. :-) This is after adding in check constraints for types and foreign key triggers (which may only be used during development anyways). Non-Pooled: 17,515.6 ms Pooled with Reset :562.5 ms Pooled without Rese

RE: [sqlite] How fast is the sqlite connection created?

2007-03-01 Thread Samuel R. Neff
ED] Sent: Wednesday, February 28, 2007 9:30 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] How fast is the sqlite connection created? Samuel R. Neff wrote: > Some of this performance gain is probably related to caching data and query > plan, not just opening the connection, but still

RE: [sqlite] How fast is the sqlite connection created?

2007-03-01 Thread Samuel R. Neff
While cursors are generic to all databases, to me the test and code sample seems to be very specific to Python. Looking at the code I can't imagine there are actually any SQLite C calls within the cursor() method. sqlite3.Connection() undoubtedly maps to sqlite3_open() and cursor.execute() would

[sqlite] 8 byte integer not same as MSSQL bigint -- missing one value

2007-03-07 Thread Samuel R. Neff
Just out of curiosity, why is the range for an 8 byte integer in SQLite one number off from the 8 byte bigint in MSSQL? SQLite: -9223372036854775807 through 9223372036854775807 MSSQL : -9223372036854775808 through 9223372036854775807 Values are from testing with SQLite 3.3.12 and MSSQL 2005. S

RE: [sqlite] Update question

2007-03-07 Thread Samuel R. Neff
Try this: UPDATE items SET price = ( SELECT price FROM month WHERE id = items.id) WHERE id IN (SELECT id from month); HTH, Sam --- We're Hiring! Seeking a passionate developer to join our team building products. Position is in t

RE: [sqlite] stupid man's manual to sqlite?

2007-03-08 Thread Samuel R. Neff
I'd suggest Mike Owens book "The Definitive Guid to SQLite". We just started working with SQLite and are very impressed by the book. It's a very easy read, well written, and covers a ton of details of internals on SQLite. There are several chapters with examples on using the C API (as well as ot

RE: [sqlite] Case Insensitive Equality Searches

2007-03-08 Thread Samuel R. Neff
Actually converting everything to upper-case (or lower-case) does not achieve case-insensitive comparison in all locales. Here's a thread on the subject with examples in C#, but assuming consistent i18n support the issue would affect all programming environments. http://groups.google.com/group/m

RE: [sqlite] stupid man's manual to sqlite?

2007-03-09 Thread Samuel R. Neff
I originally wasn't going to buy the book because according to the TOC it look like it was generally about SQL and the C API and not too much that would be helpful for us being knowledgeable in SQL in general and not using the C API. We did buy it 'cause we're basically betting our new product on

RE: [sqlite] How do I know what DBs I have attached?

2007-03-09 Thread Samuel R. Neff
pragma database_list; will list all db's including attached (i.e., main, temp, plus attached). Remember attached db's are per-connection only. Personally I'd like to see an "attach if not attached" command 'cause the way I work with connections and attached db's it would have been much easier to

RE: [sqlite] journal - "Unable to open the database file"

2007-03-09 Thread Samuel R. Neff
Extensions monitored by Windows Desktop Search are stored in the registry: HKEY_CURRENT_USER\Software\Microsoft\RSSearch\ContentIndexCommon\Filters\Ext ension http://addins.msn.com/devguide.aspx I don't know what the default extension list is. Also, the wiki has information about how and what

RE: [sqlite] ISO8601 8-byte packed date type

2007-03-09 Thread Samuel R. Neff
Personally I'd forgo a few millennia in exchange for more accuracy :-) Sam --- We're Hiring! Seeking a passionate developer to join our team building products. Position is in the Washington D.C. metro area. If interested contact [EMAIL PROTECTED] -

RE: [sqlite] Script Language

2007-03-09 Thread Samuel R. Neff
The original post said the goal is to teach algorithms, not programming language design. So for teaching algorithms I'd have to agree that using a custom language is not the best choice. For teaching how to write a programming language, then of course you want to learn how to create your own. M

RE: [sqlite] are nested joins possible ?

2007-03-09 Thread Samuel R. Neff
give the nested select an alias so you can reference it: SELECT * FROM Patient_Text INNER JOIN ( SELECT * FROM Patient INNER JOIN Opnamen ON Patient.PatNr = Opnamen.PatNr ) N ON N.PatNr = Patient_Text.PatNr But if this is your actual query then I would suggest either joining all

RE: [sqlite] Re: are nested joins possible ?

2007-03-09 Thread Samuel R. Neff
Igor, I was able to run the query with just a sub-select alias and no column aliases. No error on the duplicated PatNr column from the inner select *. I agree that I would expect sqlite to produce some kind of ambiguous column name error or something but didn't get one. Best regards, Sam

RE: [sqlite] stupid man's manual to sqlite?

2007-03-12 Thread Samuel R. Neff
Apress does have an online index they call "superindex" which indexes all Apress books. But I just did some test searches and found it to be equally useless. You can't search a specific book and some searches that obviously should have returned results didn't. In case you have better luck, the

[sqlite] Possible to get international collation built in to SQLite main distribution?

2007-03-12 Thread Samuel R. Neff
Is there any chance of getting an international-aware case-insensitive collation option put into the core language, at least as a compilation option? Seems that if SQLite is so focused on UTF data and so many users are international, the limitation of available options being English A-Z compariso

RE: [sqlite] Re: Re: Meta Information: How to retrieve the column names of a table ?

2007-03-15 Thread Samuel R. Neff
Dennis, Do any database systems actually implement this part of the standard? MSSQL used the term information schema in their MSSQL 2000 version of metadata access but afaik it was not close to the ANSI standard at all. It's a been a while for me but I think the Oracle stuff is totally different

RE: [sqlite] Re: Re: Meta Information: How to retrieve the column names of a table ?

2007-03-16 Thread Samuel R. Neff
ssage- From: Dennis Cote [mailto:[EMAIL PROTECTED] Sent: Thursday, March 15, 2007 1:02 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Re: Re: Meta Information: How to retrieve the column names of a table ? Samuel R. Neff wrote: > Dennis, > > Do any database systems actually implemen

RE: [sqlite] Finding linked peers

2007-03-20 Thread Samuel R. Neff
It's much easier to load all the data into a in-memory hierarchical structure and work with it from memory than try to come up with individual SQL statements. Some things you could do easily like find the leaf nodes (i.e., use a sub-select and identify nodes that nobody else uses as a parent) or

RE: [sqlite] Holding sqlite connection

2007-03-22 Thread Samuel R. Neff
If the database schema is not small then use opening a connection does make a difference. In initial testing we found opening a connection with 100 simple test tables take 3 ms. Later testing with our actual schema which has fewer tables but is more complex takes 17ms (~65 tables with indexes an

RE: [sqlite] open an open sqlite database !!!

2007-03-26 Thread Samuel R. Neff
If you're using ASP.NET I'd suggest using the ADO.NET wrapper available here: http://sqlite.phxsoftware.com/ It's an excellent implementation of ADO.NET for SQLite and would be far less trouble than using sqlite directly from .NET code. HTH, Sam --- We'

RE: [sqlite] Re: Currency Formatting within SQLite

2007-04-06 Thread Samuel R. Neff
> Yes, I know about creating a function but I'm wondering if I can hook > into the already-existing Windows API function for it. You don't need to write a totally custom function, just something that bridges the two API's. Create a function that implements the expected SQLite call spec and the

RE: [sqlite] Re: Currency Formatting within SQLite

2007-04-06 Thread Samuel R. Neff
lf Of Mitchell Vincent Sent: Friday, April 06, 2007 11:54 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Re: Currency Formatting within SQLite It sounds so easy when you say it like that! :-) Thanks Mr, Neff! I'll get to reading! On 4/6/07, Samuel R. Neff <[EMAIL PROTECTED]> wrot

RE: [sqlite] Implementing type find on a large result set

2007-04-06 Thread Samuel R. Neff
Instead of using LIKE use '<' to get a count of records before the one your targeting. Something like this would work (names are from my schema): SELECT PermissionRef FROM LU_Permissions LIMIT 10 OFFSET ( SELECT COUNT(*) FROM LU_Permissions WHERE PermissionRef < 'Sc'

RE: [sqlite] Master table with child FTS table

2007-04-09 Thread Samuel R. Neff
Might I suggest trying the exact same scenario with FTS1 instead of FTS2? It won't help solve the problem directly but if it works with FTS1 then it identifies where the problem is--your code or the FTS code. Also the same scenario can be tried with plain tables instead of FTS at all, again just

RE: [sqlite] Master table with child FTS table

2007-04-09 Thread Samuel R. Neff
Then perhaps an insert into a VIEW with an INSTEAD OF trigger would be appropriate? Best regards, Sam --- We're Hiring! Seeking a passionate developer to join our team building products. Position is in the Washington D.C. metro area. If interested conta

RE: [sqlite] SQLite and nested transactions

2007-04-10 Thread Samuel R. Neff
I personally would see value in supporting quasi-nested transactions where they are nested in name only--increment decrement a counter and commit on last commit, rollback entire transaction on first rollback. This would have the advantage that the library would support issuing multiple BEGIN TRANS

RE: [sqlite] SQLite and nested transactions

2007-04-10 Thread Samuel R. Neff
Aren't there different levels of backwards compatibility in play here? Backwards compatibility of the API and making sure begin/commit/rollback processes work the same with old and new versions is not the same as having the ability to take a crashed SQLite db including it's rollback journal and re

RE: [sqlite] SQLite and nested transactions

2007-04-10 Thread Samuel R. Neff
CTED] Sent: Tuesday, April 10, 2007 5:45 PM To: sqlite-users@sqlite.org Subject: RE: [sqlite] SQLite and nested transactions At 9:20 AM -0400 4/10/07, Samuel R. Neff wrote: >Under what circumstances would an older version of SQLite be >used to rollback a newer journal? Situations I am thinking

RE: [sqlite] storing the tables in separate files

2007-04-11 Thread Samuel R. Neff
Not that I would suggest it, but you could create a separate database for each table and then attach the databases to a single connection to join data together. The indexes will need to be in the same database as the table they index. But why do you want each table in a different file? Sam ---

[sqlite] Performance analysis of SQLite statements

2007-04-12 Thread Samuel R. Neff
Are there any tools to help analyze the performance of components with a particular SQLite statement? I'm aware of the EXPLAIN option which can show what VBDE code was used to execute a statement, but afaik there is no way to tell the time each step took. Basically I want to know how long the di

RE: [sqlite] Help with SQL syntax. Ticket #2296

2007-04-12 Thread Samuel R. Neff
Andy's answer and explanation is consistent with my experience and expectations too.. mostly from MSSQL and Access background. Sam --- We're Hiring! Seeking a passionate developer to join our team building products. Position is in the Washington D.C. metr

RE: [sqlite] Help with SQL syntax. Ticket #2296

2007-04-12 Thread Samuel R. Neff
Wouldn't implementation dependent mean it's not really standardized? The way I read it the query could still be considered legal in some dbms and not in others (which stinks). Besides, the current version of SQLite seems to match on the first tables names which is consistent with expectations

RE: [sqlite] Help with SQL syntax. Ticket #2296

2007-04-12 Thread Samuel R. Neff
2007 11:09 PM To: [EMAIL PROTECTED] Subject: Re: [sqlite] Help with SQL syntax. Ticket #2296 On 4/12/07, Samuel R. Neff <[EMAIL PROTECTED]> wrote: > > > Wouldn't implementation dependent mean it's not really standardized? The > way I read it the query could still b

RE: [sqlite] Still getting "Insertion failed because database is full." errors

2007-04-13 Thread Samuel R. Neff
I would suggest including the SQL that was being processed, including all parameters, in the error message. Even better would be to keep a log of all SQL messages sent--perhaps keep the last X calls in memory and when an error occurs log all of those calls and then the offending one. log4net h

RE: [sqlite] Supporting databases larger than 2GB on FAT filesystems?

2007-04-13 Thread Samuel R. Neff
You can break up the db into multiple databases and attach them to the same connection. That would be easiest approach (as long as one individual table is not bigger than 2gb). Sam --- We're Hiring! Seeking a passionate developer to join our team buildi

RE: [sqlite] Insert order maintained?

2007-04-17 Thread Samuel R. Neff
We got bit by this when moving from MSSQL 2000 to MSSQL 2005. MSSQL returned rows by default in PK order and one of our former developers depended on this so when the behavior changed in MSSQL 2005 (which is fine 'cause it wasn't documented or expected behavior) our app broke in unexpected ways.

RE: [sqlite] Optimize a query

2007-04-17 Thread Samuel R. Neff
afaik SQLite will only use one index per table so if you have a where clause "WHERE public = 1 and _rowid IN (...)" it will use an index on public and not _rowid. Swapping the where clause around should have a significant impact: select _rowid, public_id, vote_count,

[sqlite] PRAGMA short_column_names ignored when GROUP BY is used

2007-04-17 Thread Samuel R. Neff
It looks like short_column_names pragma is ignored when GROUP BY is used in a query. Is this considered expected behavior? I hope not.. :-) Thanks, Sam sqlite> pragma short_column_names; short_column_names -- 1 sqlite> pragma full_column_names; full_column_names --

RE: [sqlite] Still getting "Insertion failed because database isfull." errors

2007-04-18 Thread Samuel R. Neff
One thing to note is that the SQLite.NET wrapper by default issues all transactions as "BEGIN IMMEDIATE" so if you're running the SELECT within a transaction it will be within the context of an exclusive transaction (that's what BEGIN IMMEDIATE means, right?). You can override this by using the

RE: [sqlite] Efficiency and Pragmas

2007-04-18 Thread Samuel R. Neff
cache is per-connection so if you open and close connections a lot then a large cache won't help your program. The command line app is a single connection so a large cache there will help (although not with the first queries--only subsequent ones). Synchronous off is dangerous. Search the histor

RE: [sqlite] Still getting "Insertion failed because database isfull." errors

2007-04-18 Thread Samuel R. Neff
e: [sqlite] Still getting "Insertion failed because database isfull." errors OK, now I am confused... On 4/18/07, Samuel R. Neff <[EMAIL PROTECTED]> wrote: > > > One thing to note is that the SQLite.NET wrapper by default issues all > transactions as "BEGIN IMMEDIAT

RE: [sqlite] Still getting "Insertion failed because database isfull." errors

2007-04-18 Thread Samuel R. Neff
So as of the next version of SQLite, transactions on reads for performance will no longer be necessary.. That's great! Thanks, Sam --- We're Hiring! Seeking a passionate developer to join our team building products. Position is in the Washington D.C. m

RE: [sqlite] Still getting "Insertion failed because database isfull." errors

2007-04-18 Thread Samuel R. Neff
Another option is to change the SQLite.NET wrapper to automatically retry on SQLITE_FULL error similar to the way it handles a schema error. Then it would be transparent to your app. It would have to close and reopen the connection of course, not just retry, but still the solution is manageable a

RE: [sqlite] Prefix searching for fts2.

2007-05-01 Thread Samuel R. Neff
This is great! The main reason we decided not to use FTS in our project was lack of prefix searching. With this new functionality we'll probably switch to using FTS in a future update. One suggestion though, instead of (or in addition to) using '*' as the prefix operator perhaps '%' would be mor

RE: [sqlite] FW: Performance problem with complex where clause

2007-05-02 Thread Samuel R. Neff
Will the original poster still run into performance problems where sqlite will only use one index per table so if targetid matches on a ton of rows sqlite has to scan them all for the matching sourceid? Perhaps a multi-column index would be appropriate here to index both "target.id" and "source.i

RE: [sqlite] Transaction journal corrupted by antivirus

2007-05-03 Thread Samuel R. Neff
Most anti-virus software allows you to specify an exception folder and/or file. Tell the anti-virus to ignore sqlite db and the journal. Sam --- We're Hiring! Seeking a passionate developer to join our team building products. Position is in the Washington

RE: [sqlite] Search on Age, from DOB column

2007-05-03 Thread Samuel R. Neff
You'll be better off converting the target age back to a date and then search for the date. That way SQLite can use an index in your query (it can't use an index when the filter is on an expression). HTH, Sam --- We're Hiring! Seeking a passionate devel

RE: [sqlite] perfomance degradation for expr "foo = X or bar =X"

2007-05-09 Thread Samuel R. Neff
I wonder if it would be beneficial to add an additional where clause which can prefilter the data so you only need to perform the full calculation on a subset of records. I haven't done the math, but let's supposed that point_x is 10 and that for any result of your long calculation to be true,

RE: [sqlite] Longest "real" SQL statement

2007-05-10 Thread Samuel R. Neff
We don't do it in SQLite but as an example of how large a legitimate SQL statement can be, in a previous project we generated a pseudo-cube from the current database in a single sql statement. Basically we wanted to implement a fast complex search routine where users can choose any fields from an

[sqlite] Many small queries vs fewer large queries

2007-05-14 Thread Samuel R. Neff
Traditionally we've found that it's better to issue a few larger queries against a database (such as MSSQL or Oracle) even when the results required some processing to separate out the data because much of the cost of running a query was communication and networking overhead. Since SQLite is an i

RE: [sqlite] Limit selection by rolling sum?

2007-05-14 Thread Samuel R. Neff
filter on a nested select. select id, ( select sum(i2.size) from items i2 where i2.id <= i1.id ) sum_size from items i1 where sum_size < 5; I'm sure performance sucks :-) Something like this would be much faster to do in a pro

RE: [sqlite] Why doesn't this UPDATE work?

2007-05-25 Thread Samuel R. Neff
Try this UPDATE table1 SET column3 = ( SELECT column3 FROM table2 WHERE table2.column1 = table1.column1 AND table2.column2 = table1.column2) HTH, Sam --- We're Hiring! Seeking a passionate developer to join our team bui

RE: [sqlite] Re: CAST

2007-05-29 Thread Samuel R. Neff
Actually I'd say he gave a great explanation of why the wrapper approach is so important. Robert went through all the work to make SQLite perform in a scenario compatible with many other databases so now the users of his wrapper don't have to. Saying not to use wrappers when programming in strai

RE: [sqlite] Re: CAST

2007-05-30 Thread Samuel R. Neff
SQLite's typelessness is an asset if you work only with SQLite but in any application that uses multiple database engines of which SQLite is only one supported engine, the non-standard typelessness is something that has to be worked around. I for one would be in favor of an option to enforce stri

RE: [sqlite] Re: CAST

2007-05-30 Thread Samuel R. Neff
afaik strict affininity mode hasn't been implemented. >From http://www.sqlite.org/cvstrac/wiki?p=SqliteWikiFaq " Q) How can the strict affinity mode be used which is claimed to exist on http://www.sqlite.org/datatype3.html A) This has not been implemented as of version 3.3.13. " Sam --

RE: [sqlite] Concurrency

2007-06-01 Thread Samuel R. Neff
If option (b), using a single thread for writing and a multi-threaded write queue works in your situation, then that would probably provide best concurrency and performance. The only downside to this is the delayed writes mean you don't as easily get feedback to the original writer if a write fai

RE: [sqlite] Concurrency

2007-06-01 Thread Samuel R. Neff
Nice analogy, but in the case the cat really does have 9 lives (or many more) 'cause with SQLITE_BUSY you can just retry and while retrying is a performance penalty in my experience SQLITE_BUSY is a very rare occurrence. All I'm saying is don't fix a perceived problem until you've tested to be su

[sqlite] Does Attach improve Concurrency ?

2007-06-01 Thread Samuel R. Neff
When you have a connection with multiple attached databases and the connection acquires an exclusive lock, does it always lock all attached databases or does it keep track of which databases require the lock? Does using separate databases and attaching them improve concurrency (by providing finer

RE: [sqlite] extracting and comparing dates

2007-06-04 Thread Samuel R. Neff
SQLite doesn't have any internal notion of a date, only numbers or strings. You can choose to store dates as numbers and SQLite has some conversion functions to help you work with dates. Personally I store dates as strings. These are not properly formatted dates: 1997-6-17 1998-5-6 1997-6-24 19

RE: [sqlite] Why do you use SQLite? Comments for an article needed

2007-06-07 Thread Samuel R. Neff
We chose SQLite for many reasons: - zero configuration/installation - availability of wonderful ADO.NET 2.0 wrapper - easily extensible with custom functions - performance (4x faster than MSSQL in our tests) - available commercial support The only thing we don't like is the lack non-standard loos

[sqlite] Data structure for versioned data

2007-06-20 Thread Samuel R. Neff
Not specific to SQLite, but we're working on an app that needs to keep versioned data (i.e., the current values plus all previous values). The versioning is integral to the app so it's more than just an audit trail or history. Can anyone share experiences with the database structure for this typ

RE: [sqlite] Introducing... ManagedSQLite

2007-06-25 Thread Samuel R. Neff
Daniel, We already have an excellent ADO.NET compliant provider for SQLite that Robert mentioned. What advantages does your wrapper provide of the existing one? SQLite.NET already provides full ADO.NET support including custom functions and collation sequences written in any .NET languages and b

RE: [sqlite] How to sort not binary?

2007-06-25 Thread Samuel R. Neff
Since you use C# (mentioned in a different message) you can easily write a custom collation function with SQLite.NET. http://sqlite.phxsoftware.com/ Look in the help for SQLiteFunction and particularly FunctionType.Collation. HTH, Sam --- We're Hiring!

RE: [sqlite] Sqlite - LISTEN/NOTIFY

2007-06-28 Thread Samuel R. Neff
You could achieve this with a trigger + custom function. MSSQL 2005 now has this ability (though no SQL syntax applies, it's built into the ADO.NET 2.0 provider) and it's a really nice feature. HTH Sam --- We're Hiring! Seeking a passionate developer t

RE: [sqlite] Sparse Data Sets

2007-06-29 Thread Samuel R. Neff
Yes, there will be a performance hit 'cause when you access a column SQLite will loop through the columns in the row to find the target column. If the data is that sparse then I would suggest a different format. One that I've used a lot and have been pleased with is the following: Results - Res

RE: [sqlite] Multi-column "in" clause supported?

2007-06-29 Thread Samuel R. Neff
You can do it with a JOIN instead of IN and I'm pretty sure it will still use an index. SELECT COUNT(*) FROM guid_version_map M LEFT JOIN latest_version V ON M.guid = V.guid AND M.version = V.version WHERE

RE: [sqlite] attached databases

2007-07-04 Thread Samuel R. Neff
Use UNION to run queries against each db and return a single result. HTH, Sam --- We're Hiring! Seeking a passionate developer to join our team building products. Position is in the Washington D.C. metro area. If interested contact [EMAIL PROTECTED] --

RE: [sqlite] Using SQlite with .NET

2007-07-06 Thread Samuel R. Neff
There are a few .NET wrappers for SQLite. I would suggest System.Data.SQLite available here: http://sqlite.phxsoftware.com/ And for ADO.NET 2.0 development use version 1.0.43. For LINQ stuff use 2.0.35. Also wrapper-specific questions will probably get quicker responses in their dedicated foru

RE: [sqlite] How to implement connection pooling

2007-07-10 Thread Samuel R. Neff
If you're using a recent version of MONO then I assume you're using System.Data.SQLite from Robert Simpson which is now bundled with MONO, right? I use a custom version of the same provider which has connection pooling implemented in the wrapper. We've found it to be a huge performance improveme

RE: [sqlite] FTS and upgrades

2007-07-10 Thread Samuel R. Neff
Even without having FTS1 loaded, can't you delete the *_content and *_term tables directly and that would be effectively the same as deleting the virtual table? Sam --- We're Hiring! Seeking a passionate developer to join our team building products. Pos

RE: [sqlite] RE: Replicating table data from sqlite to ms sql server

2007-07-10 Thread Samuel R. Neff
Are you using sqlite directly or some wrapper? If you're using a wrapper then most likely you can write the MSSQL integration code in the same language as the wrapper which would undoubtedly be easier than writing it in straight C. Sam --- We're Hiring!

RE: [sqlite] How to implement connection pooling

2007-07-11 Thread Samuel R. Neff
I believe the most important factor in whether connection pooling will be useful is how complex your schema is. The more complex your schema, the longer it will take to open a new connection. Remember the choice should not be between using a single static connection and a connection pool but s

RE: [sqlite] Binding vs No Binding

2007-07-12 Thread Samuel R. Neff
I think you'll see the biggest difference when you run the same statement many times with different bound variables (vs recompiling each time). Sam --- We're Hiring! Seeking a passionate developer to join our team building products. Position is in the Wa

RE: [sqlite] Does Transaction object roll back automatically on exceptions?

2007-07-16 Thread Samuel R. Neff
Rollback is automatic if no Commit is issued in SQLite.NET. If you want custom logic, such as including additional exception information, then use try/catch BeginTransaction(); try { .. Commit(); } catch(Exception ex) { RollBack(); throw new Exception("An exception occurred and the trans

RE: [sqlite] Does Transaction object roll back automatically on exceptions?

2007-07-17 Thread Samuel R. Neff
Note that by default the ADO.NET wrapper executes transactions in immediate mode which is not desirable for read-only data. To start a deferred transaction, you need to use the SQLite.NET-specific overload BeginTransaction(true) which is not available if using the DbProvider object model. Best r

RE: [sqlite] How many table can i create in a db?

2007-07-20 Thread Samuel R. Neff
SQLite parses the schema every time you open a new connection so the more complex the schema the longer it will take to connect. We have 74 tables in our database with a lot of triggers and it takes 17ms to open a connection. So even if it will let you create 10,000, the performance impact of par

RE: [sqlite] fts2 in the amalgamation source?

2007-07-26 Thread Samuel R. Neff
Unless something changed recently that I missed, fts2 is not a standard part of sqlite so including it in the standard amalgamation would be a big change. Having two distributions, one with and one without, might make sense though. Or including it with an OMIT flag would work too (default to omi

RE: [sqlite] how do i generate a uniqueidentifier ?

2007-07-27 Thread Samuel R. Neff
I don't think there's any built-in way but you can create a custom function for it pretty easily. Are you using sqlite directly or a wrapper? Sam --- We're Hiring! Seeking a passionate developer to join our team building products. Position is in the Was

[sqlite] SQLite roadmap?

2007-08-03 Thread Samuel R. Neff
Is there a roadmap of major planned features in upcoming releases? I didn't see anything on the wiki or site.. Thanks, Sam --- We're Hiring! Seeking a passionate developer to join our team building products. Position is in the Washington D.C. metro are

RE: [sqlite] Is SQLite Case Sensitive?

2007-08-07 Thread Samuel R. Neff
Use of either "OR" or "Lower/Upper" will bypass any index and force a full table scan. Much better to use COLLATE NOCASE instead or a custom collation if you need internationalized comparisons. Sam --- We're Hiring! Seeking a passionate developer to join

RE: [sqlite] ALTER TABLE and INTEGER PRIMARY KEY.

2007-08-14 Thread Samuel R. Neff
+1 for fts3 or fts2_1 :-) --- We're Hiring! Seeking a passionate developer to join our team building products. Position is in the Washington D.C. metro area. If interested contact [EMAIL PROTECTED] -Original Message- From: Scott Hess [mailto:[EMA

RE: [sqlite] why doesn't this work? (fts rowids)

2007-08-15 Thread Samuel R. Neff
With FTS3 can you specify the rowid to use in SQL or is it always automatic? It seems like most commonly you'd want the FTS data to match up with a real table using the same key and not have to store the FTS key in a separate table. Ideally I'd want to be able to include a single foreign key inde

RE: [sqlite] Sqlite crash in two lines...

2007-08-15 Thread Samuel R. Neff
I get a crash with 3.3.12 but correct syntax error in 3.4.2 on Windows XP using exe's downloaded from sqlite.org. Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\sam>sqlite3 SQLite version 3.3.12 Enter ".help" for instructions sqlite> crea

RE: [sqlite] Problem loading extension in Delphi (FTS2)

2007-08-16 Thread Samuel R. Neff
loadable extensions are not required to create custom functions, and having access to source is not required for custom functions either. SQLite.NET provides very clean support for custom functions written in any .NET language and they are loaded automatically by the wrapper from any DLL present

RE: [sqlite] To increase search speed

2007-08-20 Thread Samuel R. Neff
Method 3, normalization, is the right route but I think the implementation needs a little more work. First don't store both Artist ID and Artist Name in the Music table--only store the ID. This goes for AlbumID/Name and GenreID/Name as well. Then reorder the columns to put the integers first in

RE: [sqlite] FTS2 Question again Python + .NET

2007-08-20 Thread Samuel R. Neff
" I'm having the same problem with .net, cant find a function which does this... " Which .NET wrapper are you using? System.Data.SQLite has FTS2 precompiled. http://sqlite.phxsoftware.com Sam --- We're Hiring! Seeking a passionate developer to join ou

RE: [sqlite] New Operator Support

2007-09-07 Thread Samuel R. Neff
Wouldn't it be a lot easier to just create a custom function? What's the advantage (other than pretty syntax) of using a custom operator? Sam --- We're Hiring! Seeking a passionate developer to join our team building products. Position is in the Washing

RE: [sqlite] Adding additional operators to FTS3

2007-09-14 Thread Samuel R. Neff
The /10 syntax makes sense to programmers but I think users are going to forget it pretty quickly. Same with "OR" an "NEAR" being required to be all caps (I didn't know that). Ideally the UI an application exposes would show the user that OR and NEAR were interpreted as keywords and not tokens (

RE: [sqlite] Filesystem Layer problems

2007-09-18 Thread Samuel R. Neff
If you only need Windows compatibility you can use the System.Data.SQLite port. It's made for ADO.NET but it is also binary compatible with SQLite and can be used from C code. It includes Windows-specific encryption and is free. http://sqlite.phxsoftware.com/ With the ADO.NET stuff it's larger

RE: [sqlite] Exclusive Transactions and Attached Databases

2007-09-18 Thread Samuel R. Neff
I see the same behavior--begin exclusive causes db locked error when same db is attached twice. However, why would you want to attach the same database twice? SQLite version 3.4.2 Enter ".help" for instructions sqlite> attach 'c.dat' as c1; sqlite> attach 'c.dat' as c2; sqlite> begin exclusive;

  1   2   >