[sqlite] Lua inside SQLite

2015-08-23 Thread Darko Volaric
Wow, what a great feature. This saves me so much hacking! I planned on using virtual tables but per-query instance creation and parameter passing was going to be such a mess. On Sun, Aug 23, 2015 at 1:55 PM, Richard Hipp wrote: > On 8/23/15, Abilio Marques wrote: > > > > 1. sqlite3 CLI

[sqlite] ATTACH DATABASE statement speed

2015-08-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/23/2015 06:48 PM, Simon Slavin wrote: > Paolo is using Linux which does not do read-ahead optimization like > some versions of Windows. Therefore if he really is using an SSD > then fragmentation is not an issue. You are confusing things. The

[sqlite] DbFunctions.TruncateTime

2015-08-23 Thread Joe Mistachkin
The LINQ provider for System.Data.SQLite does not provide this function directly; however, it may be possible to use one of the core date-time related SQL functions to do it? https://www.sqlite.org/lang_datefunc.html -- Joe Mistachkin

[sqlite] ATTACH DATABASE statement speed

2015-08-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/19/2015 05:56 PM, Paolo Bolzoni wrote: > I left running the pragma quick check during the night and finished > in 2 hours and 46 minutes, so it is about 8 times slower than in > ext4. Zfs is an advanced filesystem plenty of features, but this >

[sqlite] ESC_BAD_ACCESS when using a background thread

2015-08-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/23/2015 03:31 AM, Jeff M wrote: > sqlite3_step(); // occasionally crashes here (showing > ESC_BAD_ACCESS on main thread) That has three very likely causes. The first is that your internal state gets messed up, and the statement has actually

[sqlite] Lua inside SQLite

2015-08-23 Thread Richard Hipp
On 8/23/15, Abilio Marques wrote: > > 1. sqlite3 CLI doesn't seem to "load" the .so easily... The generated so is > called "lua.ext". If I run "*.load lua.ext*" it claims that there is no .so > available. I went into renaming the file to lua.so, and ran *.load lua.so* > ... Got: *Error: Shared

[sqlite] Compile warnings

2015-08-23 Thread Scott Robison
On Sat, Aug 22, 2015 at 8:07 PM, David Bennett wrote: > Of course that is the aim, as always. > > > > In this particular case, maximally portable code (that will compile and > execute correctly on all conforming compilers) must (a) ensure that the > pointer argument is valid (b) ensure that the

[sqlite] Lua inside SQLite

2015-08-23 Thread Abilio Marques
Hi, I'm a regular user of SQLite, but a first timer in this list. A few months ago, while doing some intensive but manual data processing, I created (hacked) a loadable module that allowed me to run short Lua scripts directly inside the SQL queries. That eased a lot of the work that day. I'm

[sqlite] ESC_BAD_ACCESS when using a background thread

2015-08-23 Thread Simon Slavin
On 23 Aug 2015, at 11:31am, Jeff M wrote: > Any ideas on how to debug this? Are you checking the values returned by sqlite3_prepare, sqlite3_bind, and sqlite3_step, to make sure they return SQLITE_OK ? I'm not quite sure what you mean by 'done once' -- whether it's once for the whole

[sqlite] Compile warnings

2015-08-23 Thread David Bennett
Of course that is the aim, as always. In this particular case, maximally portable code (that will compile and execute correctly on all conforming compilers) must (a) ensure that the pointer argument is valid (b) ensure that the length is valid, or zero. Where reasonably possible both should

[sqlite] design problem involving trigger

2015-08-23 Thread Barry Smith
Could this not be achieved by two indexes: one partial and one complete? CREATE UNIQUE INDEX idx_books1 ON Books(title, author); CREATE UNIQUE INDEX idx_books2 ON Books(title) WHERE author ISNULL; To save space and (maybe) time, you could put a 'WHERE author NOTNULL' on the first index. Of

[sqlite] ESC_BAD_ACCESS when using a background thread

2015-08-23 Thread Jeff M
My iOS app displays a gallery of thumbnails in a tableView (four to a row). To allow smooth scrolling, I lazy-load the image data on a background thread using dispatch_async(). sqlite3_threadsafe() returns true. sqlite3_open_v2() uses SQLITE_OPEN_FULLMUTEX. queue is a serial queue from

[sqlite] design problem involving trigger

2015-08-23 Thread R.Smith
On 2015-08-23 03:32 AM, Barry Smith wrote: > Could this not be achieved by two indexes: one partial and one complete? > > CREATE UNIQUE INDEX idx_books1 ON Books(title, author); > > CREATE UNIQUE INDEX idx_books2 ON Books(title) WHERE author ISNULL; > > To save space and (maybe) time, you could

[sqlite] DbFunctions.TruncateTime

2015-08-23 Thread R.Smith
On 2015-08-23 12:16 AM, Steffen Mangold wrote: > Hi Ryan, > > I get your point. :) > It seems the I was misunderstanding this help mailing list. I thought it's > also support for 'System.Data.SQLite'. > > In the way 'System.Data.SQLite' is an ADO.NET provider for SQLite and also > give support

[sqlite] : it seems to be only orber by and group

2015-08-23 Thread R.Smith
This will work great - just a correction, there should be a comma after "columnB" in the order by clause, else it might not parse, so the revised is: SELECT * FROM table ORDER BY columnA, columnB, CASE WHEN columnC = 1 THEN 0 ELSE 1 END; On 2015-08-22 10:47 PM,

[sqlite] DbFunctions.TruncateTime

2015-08-23 Thread R.Smith
On 2015-08-22 10:57 PM, Steffen Mangold wrote: >> how can I trunc time in EntityFramework? >> >> I tried it this way: >> >> model.Datas >> .GroupBy(d => >> DbFunctions.TruncateTime(d.TimeStamp)) >> .Select(d => d.Key.Value) >>