Re: [sqlite] DMV available in Sqlite?

2014-07-24 Thread Richard Hipp
On Thu, Jul 24, 2014 at 3:32 PM, Andreas Hofmann wrote: > Hi, > > > > I know how to use SQL server DMV for analyzing query performance. I am > wondering if something similar to the MS SQL Server DMV is available for > Sqlite

Re: [sqlite] DMV available in Sqlite?

2014-07-24 Thread Simon Slavin
On 24 Jul 2014, at 8:32pm, Andreas Hofmann wrote: > I am > wondering if something similar to the MS SQL Server DMV is available for > Sqlite DMV returns information about the database server. SQLite does not involve any servers: all database access is done by

Re: [sqlite] DMV available in Sqlite?

2014-07-24 Thread Andreas Hofmann
If not anything available, I could consider porting my db from sqlite to MSSQL and just change the data access. Wonder if anyone has attempted this and if this would give me the information what I am looking for (like: is the db designed correctly wrt indexes etc.). Thanks, Andy

Re: [sqlite] Does SQLite lock the entire DB for writes, or lock by table?

2014-07-24 Thread Simon Slavin
On 24 Jul 2014, at 3:21pm, Tom wrote: > My application presently does all the DB operations on the main thread. But > once a day I need it do the player leaderboards, which could be 500K players > or so, hence several minutes. I can't have the main thread blocking for any >

Re: [sqlite] Sometimes when my process restarts, it returns error "database is locked"

2014-07-24 Thread Simon Slavin
On 24 Jul 2014, at 8:21pm, Mayank Kumar (mayankum) wrote: > Thanks Simon. I found from the code, there are times when our process dies > without closing the db , so I will be fixing those. > > Regarding >> Do you call have a timeout value set before you make the API call

Re: [sqlite] Send parameter from batch file to sqlite

2014-07-24 Thread Scott Robison
On Wed, Jul 23, 2014 at 4:28 AM, shweta gk wrote: > Hi SQlite Support Team, > > I have queries to generate csv file written in a export.sql file. I'm > calling export.sql from a batch file. > > One of the queries in export.sql has where clause , to which i have to > send a

Re: [sqlite] Send parameter from batch file to sqlite

2014-07-24 Thread Tony Papadimitriou
Not possible directly from SQLite. Some weeks ago I suggested a possible way to have this capability added to the shell version of SQLite3 but there seems to be zero interest from the developers. So, don't hold your breath. Better yet, write a Lua script or something to do it. (If you do,

Re: [sqlite] Hexadecimal integer literals

2014-07-24 Thread Scott Robison
Right, I've seen the 0o prefix syntax, I just figured I was already pushing my luck with the 0b prefix. Regardless, I wanted to speak against the idea of true C style octal constants before someone else asked for them. :) Apologies for top posting, on my phone. On Jul 24, 2014 2:58 AM, "Markus

Re: [sqlite] Does SQLite lock the entire DB for writes, or lock by table?

2014-07-24 Thread Richard Hipp
WAL mode (http://www.sqlite.org/wal.html) allows one process to write to the database while another reads. That might solve your problem. On Thu, Jul 24, 2014 at 10:21 AM, Tom wrote: > > OK that's what I figured. > > My application presently does all the DB operations on the

[sqlite] DMV available in Sqlite?

2014-07-24 Thread Andreas Hofmann
Hi, I know how to use SQL server DMV for analyzing query performance. I am wondering if something similar to the MS SQL Server DMV is available for Sqlite (http://msdn.microsoft.com/en-us/library/ms188754.aspx)? Anyone? Thanks Andy ___

Re: [sqlite] Does SQLite lock the entire DB for writes, or lock by table?

2014-07-24 Thread Tom
OK that's what I figured. My application presently does all the DB operations on the main thread. But once a day I need it do the player leaderboards, which could be 500K players or so, hence several minutes. I can't have the main thread blocking for any significant length of time - a second or

Re: [sqlite] Sometimes when my process restarts, it returns error "database is locked"

2014-07-24 Thread Mayank Kumar (mayankum)
Thanks Simon. I found from the code, there are times when our process dies without closing the db , so I will be fixing those. Regarding > Do you call have a timeout value set before you make the API call which opens > the database ? How does this impact the locked db ? -mayank -Original

Re: [sqlite] Memory ownership for sqlite3_temp_directory

2014-07-24 Thread Richard Hipp
On Wed, Jul 23, 2014 at 1:29 PM, Nicolás Brailovsky wrote: > > Android. If I don't specify the temp dir, I end up triggering a bunch of > bugs in fuse :) > We've heard that before. And we had a patch in the code at

Re: [sqlite] feature request: aliasing (or renaming) db (not table) names

2014-07-24 Thread Stephan Beal
On Thu, Jul 24, 2014 at 4:51 PM, Stephan Beal wrote: > [stephan@host:~/cvs/fossil/libfossil/src]$ f-query -e "select * from > ckout.vfile limit 1" -S > BTW: the -S option has historically meant "SQL Tracing," but i think i'll rename it to "Simon" now ;). i've been

Re: [sqlite] feature request: aliasing (or renaming) db (not table) names

2014-07-24 Thread Stephan Beal
On Thu, Jul 24, 2014 at 4:45 PM, Simon Slavin wrote: > > On 24 Jul 2014, at 3:38pm, Stephan Beal wrote: > > > THANK YOU! > > You're welcome. I'm still learning more from this list than I'm putting > out. > Hope we never meet, because i will likely

Re: [sqlite] feature request: aliasing (or renaming) db (not table) names

2014-07-24 Thread Simon Slavin
On 24 Jul 2014, at 3:38pm, Stephan Beal wrote: > THANK YOU! You're welcome. I'm still learning more from this list than I'm putting out. Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] feature request: aliasing (or renaming) db (not table) names

2014-07-24 Thread Stephan Beal
On Thu, Jul 24, 2014 at 4:10 PM, Simon Slavin wrote: > > On 24 Jul 2014, at 3:07pm, Stephan Beal wrote: > > > A simpler solution which would serve my goals just as well: the ability > to > > rename only 'main' (e.g. sqlite3_rename_db(sqlite3*, char

Re: [sqlite] feature request: aliasing (or renaming) db (not table) names

2014-07-24 Thread Simon Slavin
On 24 Jul 2014, at 3:07pm, Stephan Beal wrote: > A simpler solution which would serve my goals just as well: the ability to > rename only 'main' (e.g. sqlite3_rename_db(sqlite3*, char const * > newName)). i don't need 'main' because main is fluid in these apps. i need > a

Re: [sqlite] feature request: aliasing (or renaming) db (not table) names

2014-07-24 Thread Stephan Beal
On Thu, Jul 24, 2014 at 4:02 PM, Simon Slavin wrote: > Really ? It would dramatically simplify your programming and not take up > much space. Oh well. > It's not the space, but the "pile of files" debate which has raged for years in SCMs. Fossil already has its one

Re: [sqlite] feature request: aliasing (or renaming) db (not table) names

2014-07-24 Thread Simon Slavin
On 24 Jul 2014, at 2:52pm, Stephan Beal wrote: > note that i can't justify using a file for this purpose, because that file > has to live somewhere, and the only reasonable place for it is in the > checkout directory. It would clutter the source trees. Really ? It would

Re: [sqlite] feature request: aliasing (or renaming) db (not table) names

2014-07-24 Thread Stephan Beal
On Thu, Jul 24, 2014 at 3:51 PM, Stephan Beal wrote: > i did in fact try that (way back in the beginning), using a :memory: db as > my main db. > note that i can't justify using a file for this purpose, because that file has to live somewhere, and the only reasonable

Re: [sqlite] feature request: aliasing (or renaming) db (not table) names

2014-07-24 Thread Stephan Beal
On Thu, Jul 24, 2014 at 3:18 PM, Simon Slavin wrote: > Create a fourth database with no content. That's always the main one. > Everything else is always attached to it. > i did in fact try that (way back in the beginning), using a :memory: db as my main db. However, the

Re: [sqlite] feature request: aliasing (or renaming) db (not table) names

2014-07-24 Thread Simon Slavin
On 24 Jul 2014, at 2:11pm, Stephan Beal wrote: > The problem is, an application does not > (cannot) necessarily know which order the dbs were opened, so it doesn't > really know if "main" is the repo db, the checkout db, or the config db. Create a fourth database with no

[sqlite] feature request: aliasing (or renaming) db (not table) names

2014-07-24 Thread Stephan Beal
Hi, sqlite team, i meant to address this directly to Richard a couple weeks back, but we got carried away with other topics... In the Fossil SCM and (by extension) libfossil, we juggle 1-3 db handles for the config, checkout, and repo dbs. The first db which gets opened (it's use-case

Re: [sqlite] Producing RFC4180-compliant CSV output

2014-07-24 Thread Simon Slavin
On 24 Jul 2014, at 1:21pm, Richard Hipp wrote: > www.sqlite.org/src/info/16c8ce10e15 If I might suggest, for maximum flexibility, that the end-line-separator accept the following values: CR NL CRNL r n rn and maybe even \r \n \r\n . That should future-proof it. Simon.

Re: [sqlite] Producing RFC4180-compliant CSV output

2014-07-24 Thread Richard Hipp
On Thu, Jul 24, 2014 at 7:47 AM, Richard Hipp wrote: > > > > On Thu, Jul 24, 2014 at 6:15 AM, Peter Waller > wrote: > >> Unfortunately, we already tried this, sed, and writing our own translation >> program in C. >> > > The other problem is that it adds

Re: [sqlite] Does SQLite lock the entire DB for writes, or lock by table?

2014-07-24 Thread Simon Slavin
On 24 Jul 2014, at 8:01am, Tom wrote: > 1. read various fields from table A as inputs to the leaderboard calculation > 2. in a thread, compute leaderboard and write to table B (which main thread > doesn't write to). > > In other words, the main thread only writes to table A

[sqlite] Does SQLite lock the entire DB for writes, or lock by table?

2014-07-24 Thread Tom
I have a DB operation that will take a few minutes (computing a leaderboard) so it needs to be done in a background thread (with its own connection). I was hoping to do this: 1. read various fields from table A as inputs to the leaderboard calculation 2. in a thread, compute leaderboard and

[sqlite] Async I/O not working for me on v 3.8.5

2014-07-24 Thread Tom
Test code follows. The update query takes 3 seconds with or without the async code. Any ideas? void Async_Thread() { sqlite3async_run(); } //- void CDatabase::Init(void) { int rc = 0;

Re: [sqlite] Producing RFC4180-compliant CSV output

2014-07-24 Thread David Empson
On 24/07/2014, at 10:15 pm, Peter Waller wrote: > I too am sad that CRLF is mandated in the specification and still in wide use > because of Windows. It may be nothing to do with Windows. CRLF is the Internet standard for the end of a line, as mentioned in RFC2234 and

Re: [sqlite] Producing RFC4180-compliant CSV output

2014-07-24 Thread Richard Hipp
On Thu, Jul 24, 2014 at 6:15 AM, Peter Waller wrote: > Unfortunately, we already tried this, sed, and writing our own translation > program in C. > The other problem is that it adds \r in front of *ever* \n, including those that are part of data and which are not record

Re: [sqlite] Fwd: Send parameter from batch file to sqlite

2014-07-24 Thread John McKown
No one here can do it for you. We're not admins. But if you go to the web site referenced at the bottom of _every single email_ from this list, you can do it yourself. On Thu, Jul 24, 2014 at 5:35 AM, shweta gk wrote: > I want to unsubscribe from this forum. Please remove

Re: [sqlite] Fwd: Send parameter from batch file to sqlite

2014-07-24 Thread shweta gk
I want to unsubscribe from this forum. Please remove my mail from the list. Its irritating to get unnessary mail. Thanks & Regards, Shweta.G.K On Wed, Jul 23, 2014 at 5:50 PM, shweta gk wrote: > Operating system : Windows > I am using DOS command shell. > Thanks & Regards,

Re: [sqlite] Producing RFC4180-compliant CSV output

2014-07-24 Thread Stephen Chrzanowski
Of course, I've not seen the code, but, I'd throw in that a command line option be added that'll force a particular mode. By default, it is 'as is' right now being platform dependent, but, if a CLO is added, either mode is forced, or toggled. I'd ask for separate toggles for forced or toggle. :]

Re: [sqlite] Producing RFC4180-compliant CSV output

2014-07-24 Thread Peter Waller
Unfortunately, we already tried this, sed, and writing our own translation program in C. In the best case it doubled (!) the CPU-time usage and ate more than one core at a time, which isn't acceptable in our environment. Making the change in place in the sqlite source has no observable impact.

Re: [sqlite] Producing RFC4180-compliant CSV output

2014-07-24 Thread Richard Hipp
On Thu, Jul 24, 2014 at 5:46 AM, Hick Gunter wrote: > How about piping your csv file through unix2dos? > Yeah. Having a unix program generate \r\n line endings just seems wrong. Standard or no standard. -- D. Richard Hipp d...@sqlite.org

Re: [sqlite] Producing RFC4180-compliant CSV output

2014-07-24 Thread Hick Gunter
How about piping your csv file through unix2dos? -Ursprüngliche Nachricht- Von: Peter Waller [mailto:pe...@scraperwiki.com] Gesendet: Donnerstag, 24. Juli 2014 11:27 An: sqlite-users@sqlite.org Cc: developers Betreff: [sqlite] Producing RFC4180-compliant CSV output Hi All, We're using

[sqlite] Producing RFC4180-compliant CSV output

2014-07-24 Thread Peter Waller
Hi All, We're using `sqlite -csv` to generate CSV files because it is the best performing thing available to us. It turns out however that the CSV spec demands CRLF line endings [1]. There is software in the wild that barfs on non-CRLF-line-ending files, such as SQL Server Integration Services

Re: [sqlite] Hexadecimal integer literals

2014-07-24 Thread Markus Schaber
Hi, Von: Scott Robison > On Wed, Jul 23, 2014 at 9:46 PM, J Decker wrote: > > > Seems like adding hex interpreting is just adding code for the sake of > > adding code. > > Unless the data is coming from some pre written text file, isn't just > > just as easy to format an into

Re: [sqlite] Hexadecimal integer literals

2014-07-24 Thread Markus Schaber
Hi, Eric, Von: Eric Rubin-Smith > > So far no one has raised the idea of using a "big int" layer to implement > proper integer arithmetic past 64 bits. The fact that it hasn't been > mentioned makes me worry that it's a blatantly silly idea for SQLite for some > reason -- but I'm tossing it out