Re: [sqlite] [server] HTTP + SQLite bundled as single EXE?

2010-05-03 Thread Gilles Ganault
On Sun, 2 May 2010 20:31:15 +0100, Simon Slavin wrote: >How are you seeing this ? You send your SQL queries via HTTP and it answers >by replying with XML ? XML or TAB-separated text. Using regexes, it's easy to parse data, unless someone knows of a better way. Besides, if

[sqlite] is it possible to return primary key column from given table ?

2010-05-03 Thread yogibabu
like this: SELECT --idcolumn-- FROM `table` -- View this message in context: http://old.nabble.com/is-it-possible-to-return-primary-key-column-from-given-table---tp28432175p28432175.html Sent from the SQLite mailing list archive at Nabble.com. ___

[sqlite] Optimising usage of LIKE

2010-05-03 Thread Ian Hardingham
Hey guys. For various embarrassing reasons, I'm using: SELECT x FROM userTable WHERE name LIKE 'name' To look up entries in my account table. Basically, the scripting language I'm using which hooks into SQLite is a bit case-agnostic. I've been told by a friend that this is extremely

Re: [sqlite] is it possible to return primary key column from given table ?

2010-05-03 Thread Simon Slavin
On 3 May 2010, at 8:14am, yogibabu wrote: > like this: SELECT --idcolumn-- FROM `table` If you always want to use a unique integer to refer to a record, you can ask for the column called '_rowid_' even if you didn't define one. You can use this in SELECT and UPDATE commands, as long as you

Re: [sqlite] Modeling SQLite databases

2010-05-03 Thread Simon Slavin
On 3 May 2010, at 5:16am, M. Bashir Al-Noimi wrote: > Does any one help me in this issue? I couldn't find any modeling tool > for SQLite on Linux?! I need a tool provides diagram database designer > just line SQLite Maestro. You are asking for a complicated GUI tool that runs under Linux.

Re: [sqlite] Optimising usage of LIKE

2010-05-03 Thread Simon Slavin
On 3 May 2010, at 9:53am, Ian Hardingham wrote: > For various embarrassing reasons, I'm using: > > SELECT x FROM userTable WHERE name LIKE 'name' > > To look up entries in my account table. Basically, the scripting > language I'm using which hooks into SQLite is a bit case-agnostic. > >

Re: [sqlite] [server] HTTP + SQLite bundled as single EXE?

2010-05-03 Thread Gilles Ganault
On Mon, 3 May 2010 11:24:49 +0100, Simon Slavin wrote: >If you're going to mostly pass data for use with web applications then JSON is >possibly a more appropriate format Thanks, I'll check it out. >The problem is not in coding it -- that's relatively easy. The problem

Re: [sqlite] Optimising usage of LIKE

2010-05-03 Thread Black, Michael (IS)
Simon's answer is probably best -- without any benchmarks it makes the most sense. You've got at least two solutions that don't require changing your data: SELECT x FROM userTable WHERE upper(name) = upper('name'); SELECT x FROM userTable WHERE name = 'name' COLLATE NOCASE. And one

Re: [sqlite] [server] HTTP + SQLite bundled as single EXE?

2010-05-03 Thread Alexey Pechnikov
See http://wiki.tcl.tk/15722 Add SQLite into it - about few minuts of time. 2010/5/3 Gilles Ganault : > I don't know if it'd be easier to combine existing HTTP server + > SQLite -- Best regards, Alexey Pechnikov. http://pechnikov.tel/

Re: [sqlite] Optimising usage of LIKE

2010-05-03 Thread Black, Michael (IS)
And I missed one more...so many solutions...so little time... CREATE TABLE userTable (name VARCHAR COLLATE NOCASE); SELECT x from userTable where name='name'; Then you'll get all case-insensitive matches too. All depends on whether or not you need to really keep the data in it's original

Re: [sqlite] [server] HTTP + SQLite bundled as single EXE?

2010-05-03 Thread Gilles Ganault
On Mon, 3 May 2010 15:01:26 +0400, Alexey Pechnikov wrote: >See http://wiki.tcl.tk/15722 Add SQLite into it - about few minuts of time. Thanks. If no one is interested in launching a project that would offer a single binary and maintain it, I'll try TCL-TK.

Re: [sqlite] Optimising usage of LIKE

2010-05-03 Thread Tim Romano
Which version of SQLite are you using? If LIKE has been overridden in the implementation you're using, it won't have the advantage of an index whatever the collation, in which case you might consider GLOB though it is case-sensitive. Regards Tim Romano

[sqlite] Optimising usage of LIKE

2010-05-03 Thread Ian Hardingham
Hey guys. For various embarrassing reasons, I'm using: SELECT x FROM userTable WHERE name LIKE 'name' To look up entries in my account table. Basically, the scripting language I'm using which hooks into SQLite is a bit case-agnostic. I've been told by a friend that this is extremely

Re: [sqlite] Optimising usage of LIKE

2010-05-03 Thread Tim Romano
By "version" I meant "implementation". On Mon, May 3, 2010 at 7:25 AM, Tim Romano wrote: > Which version of SQLite are you using? If LIKE has been overridden in the > implementation you're using, it won't have the advantage of an index > whatever the collation, in which

Re: [sqlite] Can I throw a query out to the group?

2010-05-03 Thread Tim Romano
Matt, You cannot select a column from a relation if the relation does not include the column. The query inside the ( ) returns a single column, table_id. select a_format from ( select table_id from table_id_list where prefix_code = 'MyPrefix_code' ); However, if table_id corresponds to a_format,

Re: [sqlite] [server] HTTP + SQLite bundled as single EXE?

2010-05-03 Thread Sylvain Pointeau
How do you authenticate to your http sqlite web server? is it not a security issue then? normally you would also need a server side language, so I would say apache is the only way to go, and also I don't understand why you need something specific to return JSON object. you can do it in 3 seconds

Re: [sqlite] [server] HTTP + SQLite bundled as single EXE?

2010-05-03 Thread Gilles Ganault
On Mon, 3 May 2010 14:41:10 +0200, Sylvain Pointeau wrote: >How do you authenticate to your http sqlite web server? >is it not a security issue then? SQLite is meant for local use, so people interested in an SQLite server would operate on a small LAN, protected from

Re: [sqlite] [server] HTTP + SQLite bundled as single EXE?

2010-05-03 Thread Sylvain Pointeau
if you speak about MySQL or POSTGRESQL then you mean database server, not a web server. Do you want to have a server where to connect for making your SELECT, UPDATE DELETE, CREATE? or do you want a webserver to just do some SELECT? (and having a XML, JSON or whatever) Best regards, Sylvain On

Re: [sqlite] [server] HTTP + SQLite bundled as single EXE?

2010-05-03 Thread Gilles Ganault
On Mon, 3 May 2010 14:47:48 +0200, Sylvain Pointeau wrote: >if you speak about MySQL or POSTGRESQL >then you mean database server, not a web server. Yes. Please read the thread, starting with my original post where I explain the idea.

Re: [sqlite] [server] HTTP + SQLite bundled as single EXE?

2010-05-03 Thread Sylvain Pointeau
this is not clear for me. On Mon, May 3, 2010 at 2:49 PM, Gilles Ganault wrote: > On Mon, 3 May 2010 14:47:48 +0200, Sylvain Pointeau > wrote: > >if you speak about MySQL or POSTGRESQL > >then you mean database server, not a web server. > >

Re: [sqlite] [server] HTTP + SQLite bundled as single EXE?

2010-05-03 Thread Sylvain Pointeau
option 1: a database server using sqlite behind the scene: - which language / protocole to use ? - which is the security model? (forget .htaccess, this is for apache / webserver) option 2: web server using http - only SELECT statements? - returning JSON or whatever? - which protocole to use then?

Re: [sqlite] [server] HTTP + SQLite bundled as single EXE?

2010-05-03 Thread Michael Schlenker
Sylvain Pointeau schrieb: > option 1: a database server using sqlite behind the scene: > - which language / protocole to use ? > - which is the security model? (forget .htaccess, this is for apache / > webserver) > > option 2: web server using http > - only SELECT statements? > - returning JSON

Re: [sqlite] [server] HTTP + SQLite bundled as single EXE?

2010-05-03 Thread Gilles Ganault
On Sun, 02 May 2010 21:26:27 +0200, Gilles Ganault wrote: >It's probably quite an easy thing to do for someone well versed in C, >but I haven't seen a project that would combine a web server and >SQLite into a single EXE. Here's a diagram:

Re: [sqlite] [server] HTTP + SQLite bundled as single EXE?

2010-05-03 Thread Sylvain Pointeau
I would probably take mysql or postgresql, to be able to use the "prepared statements" and other facilities. I don't see any point to implement this kind of system. or same api as sqlite but the open is taking an url instead, but you have to re-write the api of sqlite. In this case, I can see the

Re: [sqlite] [server] HTTP + SQLite bundled as single EXE?

2010-05-03 Thread Gilles Ganault
On Mon, 03 May 2010 15:22:27 +0200, Michael Schlenker wrote: >You could take the Tcl WUB webserver, which already implements a SQLQ >domain from an sqlite DB and use that. Easy to wrap in single file too. > >See http://code.google.com/p/wub/source/browse/trunk/Domains/SqlQ.tcl

Re: [sqlite] is it possible to return primary key column from given table ?

2010-05-03 Thread P Kishor
On Mon, May 3, 2010 at 2:14 AM, yogibabu wrote: > > like this: SELECT --idcolumn-- FROM `table` what is the name of the column? Is it '--idcolumn--'? Are the leading and trailing '--' part of the name? Remember that leading '--' is used as SQL comments. If that is indeed

[sqlite] Proposed new sqlite3_open_v3() interface

2010-05-03 Thread D. Richard Hipp
Community feedback is requested for the following proposed new SQLite C API: int sqlite3_open_v3(const char*, sqlite3**, int, const char*); The new database connection constructor would work exactly like sqlite3_open_v2() with the following exceptions: (1) Foreign Key constraints would

Re: [sqlite] [server] HTTP + SQLite bundled as single EXE?

2010-05-03 Thread Sam Carleton
On Mon, May 3, 2010 at 6:24 AM, Simon Slavin wrote: > > The problem is not in coding it -- that's relatively easy. The problem is > in who would use it. I think that would be mostly people who already use > PHP to write a backend data server. The advantage of this is

[sqlite] multi-threaded vs multi-process, is there a difference?

2010-05-03 Thread Sam Carleton
I am using SQLite as the backend to my little Windows Apache server based kiosk system. I load tested it with 50 clients running slide shows, aka hitting the apache server every 5 seconds and all ran wonderfully! Apache on Windows is threaded, so I only had one process running. Each connection

Re: [sqlite] Proposed new sqlite3_open_v3() interface

2010-05-03 Thread Chris
On Mon, 2010-05-03 at 10:47 -0400, D. Richard Hipp wrote: > Question 1: Are there any objections to this approach? > None here. My web-based applications (written in C) have just one call to the existing open_v2 call so it is trivial to change them. > Question 2: Are there other foibles that

Re: [sqlite] [sqlite-dev] Proposed new sqlite3_open_v3() interface

2010-05-03 Thread Jay A. Kreibich
On Mon, May 03, 2010 at 10:47:36AM -0400, D. Richard Hipp scratched on the wall: > Community feedback is requested for the following proposed new SQLite > C API: > > int sqlite3_open_v3(const char*, sqlite3**, int, const char*); > Question 1: Are there any objections to this approach?

Re: [sqlite] Proposed new sqlite3_open_v3() interface

2010-05-03 Thread Robert Simpson
My only request would be that you add some kind of flag that allows us to specify opening the database in UTF-16 mode via this interface. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of D. Richard Hipp Sent: Monday, May 03,

Re: [sqlite] Proposed new sqlite3_open_v3() interface

2010-05-03 Thread Florian Weimer
* D. Richard Hipp: > Question 2: Are there other foibles that we could correct using > sqlite3_open_v3? You could default the page size to the file system block size (if it can be determined). ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] is it possible to return primary key column from given table ?

2010-05-03 Thread yogibabu
P Kishor-3 wrote: > what is the name of the column? Is it '--idcolumn--'? That was only example written when I didn't know even for what syntax to look for. Now problem comes to how to run SELECT against PRAGMA table_info(tblname). Only way out of this that I found is to run regex against the

[sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-03 Thread Stefan Keller
I have a question regarding VIEWs in SQLite: It looks like if SQLite simply copies the column type from the original table into the corresponding view column. And I know SQLite implements some 'loose column typing'. That's ok so far. But in SQLite if a view column comes from a function result

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-03 Thread Pavel Ivanov
> Is there a way to give such columns a type anyway? I guess you aware that columns in SQLite doesn't have types? They only have "declared type" (which is arbitrary string used in CREATE TABLE statement) and affinity. OTOH values in each row have types. And neither "declared type" nor affinity

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-03 Thread Simon Slavin
On 3 May 2010, at 6:14pm, Stefan Keller wrote: > But in SQLite if a view column comes from a function result or some > computation, then the column type is NULL...!? It's not taking the > result-type as mentioned in the manual > (http://www.sqlite.org/lang_select.html) - even when I try to do a

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-03 Thread Stefan Keller
Unfortunately the application which reads from this view needs that all columns are typed - even if the values types deviate from it - and I think this is a logical assumption. So, I fear I do have only one chance and SQLite doesn't let me do it: CREATE VIEW myview AS SELECT id, name,

Re: [sqlite] [server] HTTP + SQLite bundled as single EXE?

2010-05-03 Thread Alexey Pechnikov
As example, on my laptop AOL Web Server+SQLite database + TCL scripts can perform more than 1000 HTTP request per second. But AOLServer is a solution for big projects. I am using AOLServer for projects with a few hundreds and more of concurrent user sessions. And for many projects SQLite is more

Re: [sqlite] Can I throw a query out to the group?

2010-05-03 Thread Matt Young
Thanks, I eventually ended up doing something like that,and got it working. I booked marked the your example and will try variations of it. I got most of my system working, but I am still overwhelmed with economic data releases from around the word. On 5/3/10, Tim Romano

Re: [sqlite] Proposed new sqlite3_open_v3() interface

2010-05-03 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/03/2010 07:47 AM, D. Richard Hipp wrote: > Question 2: Are there other foibles that we could correct using > sqlite3_open_v3? I'd like the shared cache busy handling to be exactly the same as non-shared cache. ie if the only line of code

[sqlite] SQLite datatypes

2010-05-03 Thread Alan Harris-Reid
Hi there, When creating a table in SQLite, I often get confused when confronted with all the possible datatypes which imply similar contents, so could anyone tell me the difference between the following data-types? INT, INTEGER, SMALLINT, TINYINT DEC, DECIMAL LONGCHAR, LONGVARCHAR

Re: [sqlite] SQLite datatypes

2010-05-03 Thread P Kishor
On Mon, May 3, 2010 at 2:17 PM, Alan Harris-Reid wrote: > Hi there, > > When creating a table in SQLite, I often get confused when confronted > with all the possible datatypes which imply similar contents, so could > anyone tell me the difference between the following

Re: [sqlite] SQLite datatypes

2010-05-03 Thread Paul Rigor (uci)
HEre's the doc: http://www.sqlite.org/datatype3.html Cheers, Paul On Mon, May 3, 2010 at 12:17 PM, Alan Harris-Reid < aharrisr...@googlemail.com> wrote: > Hi there, > > When creating a table in SQLite, I often get confused when confronted > with all the

[sqlite] Storing a wav file in the database

2010-05-03 Thread Luciano de Souza
Hi listers, Suppose I have a file called "audio.wav" and I want to store it inside a database. If I correctly understood, I could create a table like that: create table test ( id integer primary key, name text not null, file blob not null ); I have never dealt with blob fields, so perhaps

Re: [sqlite] Modeling SQLite databases

2010-05-03 Thread Kevin
I would suggest starting by looking into http://www.sqlite.org/cvstrac/wiki?p=ManagementTools regards, Kevin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Storing a wav file in the database

2010-05-03 Thread Simon Slavin
On 4 May 2010, at 1:45am, Luciano de Souza wrote: > Suppose I have a file called "audio.wav" and I want to store it inside a > database. If I correctly understood, I could create a table like that: > > create table test ( > id integer primary key, > name text not null, > file blob not null >