Re: [sqlite] Multiple tables or not

2017-03-04 Thread Joshua Grauman
Thanks! If I am able to run real world tests to see if it is perceptibly faster, I'll report back! Josh On 3/4/17, Joshua Grauman wrote: Hello all, I am wondering what would be faster for sqlite- Suppose I have a table with ~400,000 rows and ~20 columns. Suppose I only care about

[sqlite] Multiple tables or not

2017-03-04 Thread Joshua Grauman
Hello all, I am wondering what would be faster for sqlite- Suppose I have a table with ~400,000 rows and ~20 columns. Suppose I only care about read speed of the table, and that each of the columns contains 8-bit or 32-bit integers, and the first column is an ID for the row. Suppose I also hav

Re: [sqlite] Triggers to enforce table permissions

2013-12-07 Thread Joshua Grauman
Perfect! Always new nuggets of goodness discovered in sqlite. Thanks! Josh On Sat, Dec 7, 2013 at 1:45 PM, Joshua Grauman wrote: Is there a way to prevent changes to the schema, while still allowing inserts of new data to existing tables? The sqlite3_set_authorizer() interface ( http

Re: [sqlite] Triggers to enforce table permissions

2013-12-07 Thread Joshua Grauman
Ok, so now I have a new question. Is there a way to prevent changes to the schema, while still allowing inserts of new data to existing tables? I'd love to just prevent any changes to sqlite_master for a given database connection. I tried adding triggers to it similar to the ones I used below,

Re: [sqlite] Triggers to enforce table permissions

2013-12-06 Thread Joshua Grauman
Nevermind, I found the recursive_triggers PRAGMA... Thanks! Josh Hello all, I'm trying to create simple permissions for a table to prevent unwanted modification of certain table rows. I'm brand new to Triggers, but I almost have what I want working. Imagine I have a table t1 with some data,

[sqlite] Triggers to enforce table permissions

2013-12-06 Thread Joshua Grauman
Hello all, I'm trying to create simple permissions for a table to prevent unwanted modification of certain table rows. I'm brand new to Triggers, but I almost have what I want working. Imagine I have a table t1 with some data, and a permission integer. I have two triggers that prevent modifica

[sqlite] Transaction involving multiple attached databases

2013-11-26 Thread Joshua Grauman
Hello all, If I have multiple databases attached and then do a: BEGIN EXCLUSIVE I assume all the sqlite3 tables involved get locked? Is there a way to lock only one of the attached tables? Thanks. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] SQLite server/file-locking scenario

2013-11-19 Thread Joshua Grauman
NLY); or even fopen("filename", "r") under Linux, would I be safe? Under what conditions would an open() create a lock that would cause problems? Josh On 19 Nov 2013, at 5:05pm, Joshua Grauman wrote: Ok, thanks again for the tips, I'll change the ROLLBACK to END.

Re: [sqlite] SQLite server/file-locking scenario

2013-11-19 Thread Joshua Grauman
Josh On 19 Nov 2013, at 6:00am, Joshua Grauman wrote: sqlite3_open_v2("sqlite3.database.filename"); sqlite3_exec("BEGIN IMMEDIATE"); file.open("sqlite3.database.filename"); file.readAll(); file.close(); sqlite3_exec("ROLLBACK"); sqlite3_close(); S

Re: [sqlite] SQLite server/file-locking scenario

2013-11-18 Thread Joshua Grauman
Thanks again for the responses, very helpful. Taking into account that I can't just read the database file in my program without some sort of locking as was mentioned and explained clearly by multiple people (thank you!), I tried two different implementations to see which would perform better.

Re: [sqlite] SQLite server/file-locking scenario

2013-11-17 Thread Joshua Grauman
I don't have time right at this minute to carefully read and respond to all the responses to me, but I have to at least at this point say a heartfelt *thank you* to all those who have responded to me. I'm blown away by how detailed and helpful and patient all the responses are. When I have more

Re: [sqlite] SQLite server/file-locking scenario

2013-11-16 Thread Joshua Grauman
ways* in a valid state (even from the perspective of other programs that try to read it while being written)? Josh On 16 Nov 2013, at 11:37pm, Joshua Grauman wrote: Or conversely, that if sqlite has the file open to write, my program will read a cached version (if reading and writing happen a

[sqlite] SQLite server/file-locking scenario

2013-11-16 Thread Joshua Grauman
Hello all, I am writing a server program that reads and writes several different sqlite databases. Each client program can do one of the following at a time 1) send a file with a bunch of SQL statements that the server will run on the appropriate database, or 2) request an entire database file

Re: [sqlite] Formatting (left aligned) Integers

2010-11-04 Thread Joshua Grauman
After more Googling, I found this tidbit which simulates lpad for sqlite: substr('00' || mycolumn, -10, 10) Thanks! Josh > Hello all, > > The simple question is, is there any way in SQLite to format (left align) > integers? So for example I want to print 1 as 1, 23 as 00023, 102 as

[sqlite] Formatting (left aligned) Integers

2010-11-04 Thread Joshua Grauman
Hello all, The simple question is, is there any way in SQLite to format (left align) integers? So for example I want to print 1 as 1, 23 as 00023, 102 as 00102, etc. The real issue I'm trying to solve is a sorting one. I run some SQL which takes some integers and creates a column for sorti

[sqlite] Create Read-only Database

2010-10-09 Thread Joshua Grauman
I have a database that I want to be only read-only. I read in the optimization FAQ that this will make sqlite not create a journal and so run faster. I changed the permissions of my database file in Linux (removed the write permission), and sqlite was still able to create a new table. Since thi