[sqlite] syntax error on SELECT with WHERE EXISTS

2016-01-18 Thread R Smith
On 2016/01/18 11:42 PM, James Walker wrote: > Why do I get a syntax error from this SQL? > > SELECT * FROM SnappedFrames WHERE EXISTS (SELECT 1 FROM > FilmSizeOverrides); > > SQLite says the error is near SELECT, but doesn't say which SELECT. > If I say either It works fine for me - What

[sqlite] Retrieved Blob Data has 16 Byte Header or ?

2016-01-18 Thread Rooney, Joe
The process, working in iOS: * Retrieve an employee photo using web service call, encoded in Base64 string * Convert Base64 string to NSData object - 3245 bytes * Store NSData object to a Blob in SQLite - 3245 bytes * Retrieve Blob to NSData object - 3245

[sqlite] Wish list: allow developers use the power of sqliteparser

2016-01-18 Thread David Barrett
Whoaa!! This is amazing! https://www.sqlite.org/c3ref/c_alter_table.html Wow, thanks! -david On Mon, Jan 18, 2016 at 10:54 PM, Scott Hess wrote: > On Mon, Jan 18, 2016 at 10:27 PM, David Barrett > wrote: > > > One use of this I would like is to create a security framework around > >

[sqlite] Wish list: allow developers use the power of sqliteparser

2016-01-18 Thread Scott Hess
On Mon, Jan 18, 2016 at 10:27 PM, David Barrett wrote: > One use of this I would like is to create a security framework around > arbitrary SQL queries from the user. So, for example, I'd love to > determine which tables (and which columns of those tables) a particular > query is going to

[sqlite] Wish list: allow developers use the power of sqliteparser

2016-01-18 Thread David Barrett
One use of this I would like is to create a security framework around arbitrary SQL queries from the user. So, for example, I'd love to determine which tables (and which columns of those tables) a particular query is going to access, and then compare that list against a whitelist of columns the

[sqlite] Retrieved Blob Data has 16 Byte Header or ?

2016-01-18 Thread Richard Hipp
On 1/18/16, Rooney, Joe wrote: > The process, working in iOS: > > > * Retrieve an employee photo using web service call, encoded in > Base64 string > > * Convert Base64 string to NSData object - 3245 bytes > > * Store NSData object to a Blob in SQLite - 3245 bytes > > *

[sqlite] Using System.Data.SQLite on WM6.1

2016-01-18 Thread Jamie Rosensteel
I'm putting together a quick proof-of-concept application to explore the use of System.Data.SQLite for applications running on Windows Mobile 6.1 using .NET Compact Framework 3.5. As long as I put the data access logic in the application, and make sure that System.Data.SqLite.dll and

[sqlite] syntax error on SELECT with WHERE EXISTS

2016-01-18 Thread Richard Hipp
On 1/18/16, James Walker wrote: > Why do I get a syntax error from this SQL? > > SELECT * FROM SnappedFrames WHERE EXISTS (SELECT 1 FROM FilmSizeOverrides); > > SQLite says the error is near SELECT, but doesn't say which SELECT. Works when I try it. Is there a stray non-printing character

[sqlite] Wish list: allow developers use the power of sqliteparser

2016-01-18 Thread Domingo Alvarez Duarte
Is this something crazy to ask as a developer ? I think that even for the author something like this would make several tasks easier. Ideally I would like to feed the parser with an sql string, get it's syntax tree, maybe do some rewrite and feed it execute it, this possibility can open the

[sqlite] Wish list: allow developers use the power ofsqliteparser

2016-01-18 Thread Domingo Alvarez Duarte
Thank you for your reply ! It seems that we already have something done, after your suggestion I looked at the sqlite3 sources and found this function: #ifndef NDEBUG /* ** Turn parser tracing on by giving a stream to which to write the trace ** and a prompt to preface each trace message.?

[sqlite] Wish list: allow developers use the power of sqliteparser

2016-01-18 Thread Domingo Alvarez Duarte
Thank you for your reply ! I understand your point. But without remove your freedom could we have somehow an optional callback that could be registered to receive what the parser found ? It's a shame that we can not reuse the parser power ! Can we have something that do not remove your

[sqlite] Wish list: allow developers use the power ofsqliteparser

2016-01-18 Thread Hick Gunter
This will output the steps the parser does (reduce, shift, fallback,...) but not the syntax tree. -Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-bounces at mailinglists.sqlite.org] Im Auftrag von Domingo Alvarez Duarte Gesendet:

[sqlite] Wish list: allow developers use the power of sqliteparser

2016-01-18 Thread Hick Gunter
AFAICT the abstract syntax tree does not exist outside of the generated lemon parser. Only the generated VDBE code makes it to the "outside world". -Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-bounces at mailinglists.sqlite.org] Im

[sqlite] syntax error on SELECT with WHERE EXISTS

2016-01-18 Thread James Walker
On 1/18/2016 1:59 PM, R Smith wrote: > > > On 2016/01/18 11:42 PM, James Walker wrote: >> Why do I get a syntax error from this SQL? >> >> SELECT * FROM SnappedFrames WHERE EXISTS (SELECT 1 FROM >> FilmSizeOverrides); >> >> SQLite says the error is near SELECT, but doesn't say which SELECT. If >>

[sqlite] Wish list: allow developers use the power of sqliteparser

2016-01-18 Thread Simon Slavin
On 18 Jan 2016, at 2:20pm, Domingo Alvarez Duarte wrote: > Can we have something that do not remove your freedom and can provide a way > to reuse the parser power ? In the amalgamation source code you will find /* ** The interface to the LEMON-generated parser */ SQLITE_PRIVATE void

[sqlite] Wish list: allow developers use the power ofsqliteparser

2016-01-18 Thread Domingo Alvarez Duarte
Thank you for your reply ! The problem with "If you would like to write something that turns the output of that parser into a syntax tree in your preferred format, go ahead. Should be interesting." is that it's duplicated work that can/will go out of sync with sqlite repository. For the

[sqlite] syntax error on SELECT with WHERE EXISTS

2016-01-18 Thread James Walker
Why do I get a syntax error from this SQL? SELECT * FROM SnappedFrames WHERE EXISTS (SELECT 1 FROM FilmSizeOverrides); SQLite says the error is near SELECT, but doesn't say which SELECT. If I say either SELECT * FROM SnappedFrames WHERE 1; or SELECT 1 FROM FilmSizeOverrides; then there's

[sqlite] Wish list: allow developers use the power of sqliteparser

2016-01-18 Thread Domingo Alvarez Duarte
On the right panel there is a live syntax tree of the sql on the left panel, we can edit the sql on the left panel and the syntax tree on the right panel is updated. The idea is to have a way to get a syntax tree of a sql string through the sqlite parser: synatx_tree

[sqlite] Wish list: allow developers use the power of sqliteparser

2016-01-18 Thread Simon Slavin
On 18 Jan 2016, at 11:51am, Domingo Alvarez Duarte wrote: > The idea is to have a way to get a syntax tree of a sql string through the > sqlite parser: synatx_tree sqlite3_sql_syntax_tree(const char *zSql); The vast majority of copies of SQLite don't run on normal computers, they're embedded

[sqlite] Wish list: allow developers use the power of sqlite parser

2016-01-18 Thread Domingo Alvarez Duarte
Hello Richard ! Can we have a sqlite function that given a sql string return something like this https://codeschool.github.io/sqlite-parser/demo/ => Syntax Tree ? syntax_tree sqlite3_sql_syntax_tree(const char *zSql); Possible return types for sqlite3_sql_syntax_tree: - json

[sqlite] Wish list: allow developers use the power ofsqliteparser

2016-01-18 Thread Richard Hipp
On 1/18/16, Domingo Alvarez Duarte wrote: > > #ifndef NDEBUG > void sqlite3ParserTrace(FILE *TraceFILE, char *zTracePrompt){ > #endif /* NDEBUG */ > > Anyone used it ? > > What's it's output like ? That function implements PRAGMA parser_trace.

[sqlite] WAL: difference between IMMEDIATE and DEFERRED transaction

2016-01-18 Thread Rowan Worth
On 15 January 2016 at 22:09, Olivier Vidal wrote: > For the DEFERRED transaction: > > - BEGIN DEFERRED TRANSACTION > - SELECT > - UPDATE > - SELECT > - UPDATE > - INSERT > - SELECT > - COMMIT > > The lock is requested at the first UPDATE (and there have no TIMEOUT?). > The database cannot be

[sqlite] Wish list: allow developers use the power of sqlite parser

2016-01-18 Thread Richard Hipp
On 1/18/16, Domingo Alvarez Duarte wrote: > Hello Richard ! > > Can we have a sqlite function that given a sql string return something like > this https://codeschool.github.io/sqlite-parser/demo/ => > > Syntax Tree ? No. That would make the abstract syntax tree an interface, which means that we

[sqlite] Using sqlite3.exe as a subprocess

2016-01-18 Thread Hick Gunter
How to detect beginning and end of output from a SQL Statement piped to a subprocess: Initialize the subprocess with .header off .separator .mode list And then delimit your queries - SELECT ' START'; - - SELECT ' END'; Discarding everything not between the expected START and END lines

[sqlite] Wish list: allow developers use the power of sqlite parser

2016-01-18 Thread Keith Medcalf
What are we supposed to be seeing there? > -Original Message- > From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users- > bounces at mailinglists.sqlite.org] On Behalf Of Domingo Alvarez Duarte > Sent: Monday, 18 January, 2016 06:09 > To: SQLite mailing list >