Re: [sqlite] Reading a table from inside a scalar function

2019-02-18 Thread Arun - Siara Logics (cc)
>Sent: Monday, 18 February, 2019 10:08 > >To: SQLite mailing list > >Subject: Re: [sqlite] Reading a table from inside a scalar function > > > > > >SQLite does not maintain state between VDBE executions ... each > >execution is a context onto itself.

Re: [sqlite] Reading a table from inside a scalar function

2019-02-18 Thread Keith Medcalf
om: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Keith Medcalf >Sent: Monday, 18 February, 2019 10:08 >To: SQLite mailing list >Subject: Re: [sqlite] Reading a table from inside a scalar function > > >SQLite does not maintain state betwee

Re: [sqlite] Reading a table from inside a scalar function

2019-02-18 Thread Keith Medcalf
g list >Subject: Re: [sqlite] Reading a table from inside a scalar function >Importance: High > >Thanks Dominique, Thanks Simon, >Do you mean to say SQLite might keep function results across queries? >My design would be more complicated, but it is something like this: >If my fun

Re: [sqlite] Reading a table from inside a scalar function

2019-02-18 Thread Simon Slavin
On 18 Feb 2019, at 4:22pm, Arun - Siara Logics (cc) wrote: > Do you mean to say SQLite might keep function results across queries? It depends where you use it. See section 4 of However, the documentation should prepare you for the idea that you cannot

Re: [sqlite] Reading a table from inside a scalar function

2019-02-18 Thread Keith Medcalf
. >-Original Message- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Arun - Siara Logics >(cc) >Sent: Monday, 18 February, 2019 06:16 >To: SQLite mailing list >Subject: Re: [sqlite] Reading a table from inside a scalar funct

Re: [sqlite] Reading a table from inside a scalar function

2019-02-18 Thread Keith Medcalf
ary, 2019 03:06 >To: SQLite mailing list >Subject: Re: [sqlite] Reading a table from inside a scalar function >Importance: High > >> Yes it is possible, but then your UDF is unlikely to be >*Deterministic*. >By design, I intend to make sure that for any given input the

Re: [sqlite] Reading a table from inside a scalar function

2019-02-18 Thread Arun - Siara Logics (cc)
Thanks Dominique, Thanks Simon, Do you mean to say SQLite might keep function results across queries? My design would be more complicated, but it is something like this: If my function uses first part of a text column in the row involved and if I make sure all modifications are always appended

Re: [sqlite] Reading a table from inside a scalar function

2019-02-18 Thread Simon Slavin
On 18 Feb 2019, at 1:15pm, Arun - Siara Logics (cc) wrote: > Thank you, for the detailed advice, info and the pointer. Is there a faster > way to query the table using row id, that is, skip the query parsing and > planner? No. For fastest queries, use "WHERE rowid = ", and list the columns

Re: [sqlite] Reading a table from inside a scalar function

2019-02-18 Thread Dominique Devienne
On Mon, Feb 18, 2019 at 2:16 PM Arun - Siara Logics (cc) wrote: > Thank you, for the detailed advice, info and the pointer. Is there a > faster way to query the table using row id, that is, skip the query parsing > and planner? I still need the page cache feature and allow for concurrent >

Re: [sqlite] Reading a table from inside a scalar function

2019-02-18 Thread Arun - Siara Logics (cc)
Thank you, for the detailed advice, info and the pointer. Is there a faster way to query the table using row id, that is, skip the query parsing and planner? I still need the page cache feature and allow for concurrent modification of the row involved, while ensuring determinism by designing

Re: [sqlite] Reading a table from inside a scalar function

2019-02-18 Thread Dominique Devienne
On Mon, Feb 18, 2019 at 1:05 PM R Smith wrote: > If not, I apologize, and is very interested in where then > "read_uncommitted" becomes useful? > read_uncommitted is about changes in *other* transactions than your own. You can always see your own changes, in *your* current transaction.

Re: [sqlite] Reading a table from inside a scalar function

2019-02-18 Thread R Smith
On 2019/02/18 1:02 PM, Dominique Devienne wrote: On Mon, Feb 18, 2019 at 11:48 AM R Smith wrote: Note that in a transaction without WAL mode ... your query may or may not "see" data that is older, Hmmm, I don't think so. Journal mode, WAL or not, doesn't matter. If you are inside a

Re: [sqlite] Reading a table from inside a scalar function

2019-02-18 Thread Dominique Devienne
On Mon, Feb 18, 2019 at 12:25 PM Richard Hipp wrote: > On 2/18/19, Arun - Siara Logics (cc) wrote: > > If known, kindly point me to an existing open source implementation. > > https://www.sqlite.org/src/file/ext/misc/eval.c Looks like the code was updated to use sqlite3_realloc64() despite

Re: [sqlite] Reading a table from inside a scalar function

2019-02-18 Thread Richard Hipp
On 2/18/19, Arun - Siara Logics (cc) wrote: > Hi, > > This is for an experimental feasibility study. Is it possible to read > specific row(s) from a table within same db (using row ids) from inside a > User defined Deterministic scalar function (C API)? > > If known, kindly point me to an

Re: [sqlite] Reading a table from inside a scalar function

2019-02-18 Thread Dominique Devienne
On Mon, Feb 18, 2019 at 11:48 AM R Smith wrote: > Note that in a transaction without WAL mode ... your query may or may not > "see" data that is older, > Hmmm, I don't think so. Journal mode, WAL or not, doesn't matter. If you are inside a transaction, you are inside it. And will see the

Re: [sqlite] Reading a table from inside a scalar function

2019-02-18 Thread R Smith
On 2019/02/18 12:06 PM, Arun - Siara Logics (cc) wrote: Yes it is possible, but then your UDF is unlikely to be *Deterministic*. By design, I intend to make sure that for any given input the function always returns the same value. If the dependent rows are missing or change over time, then it

Re: [sqlite] Reading a table from inside a scalar function

2019-02-18 Thread Arun - Siara Logics (cc)
> Yes it is possible, but then your UDF is unlikely to be *Deterministic*. By design, I intend to make sure that for any given input the function always returns the same value. If the dependent rows are missing or change over time, then it would be an error condition. What would be the

Re: [sqlite] Reading a table from inside a scalar function

2019-02-18 Thread Dominique Devienne
On Mon, Feb 18, 2019 at 9:58 AM Arun - Siara Logics (cc) wrote: > [...]. Is it possible to read specific row(s) from a table within same > db (using row ids) from inside a User defined Deterministic scalar function > (C API)? > Yes it is possible, but then your UDF is unlikely to be

[sqlite] Reading a table from inside a scalar function

2019-02-18 Thread Arun - Siara Logics (cc)
Hi, This is for an experimental feasibility study. Is it possible to read specific row(s) from a table within same db (using row ids) from inside a User defined Deterministic scalar function (C API)? If known, kindly point me to an existing open source implementation. Thanks Arun