Re: [sqlite] Lazy virtual table creation

2018-03-19 Thread Dominique Devienne
On Sat, Mar 17, 2018 at 11:42 PM, Marco Bambini  wrote:

> with a bit of work you can use the authorize api in order to know when an
> access to a non existing table is performed.
> https://sqlite.org/c3ref/set_authorizer.html


Interesting work-around, if that works. I.e. whether name resolution to
table/column happens before or after the authorizer is called.

But it brings up the more general question of knowing which APIs are safe
to call inside other APIs,
notably when doing schema changes for example. In this case for example,
we'd typically be inside
a prepare statement, and is it OK to change the schema, potentially
affecting that very statement we
are currently parsing/resolving/compiling?

I.e. API re-entrance but outside the context of multi-threading I guess.
--DD
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Lazy virtual table creation

2018-03-17 Thread Marco Bambini
Philippe,
with a bit of work you can use the authorize api in order to know when an 
access to a non existing table is performed.
https://sqlite.org/c3ref/set_authorizer.html

Hope this helps.
--
Marco Bambini
http://www.sqlabs.com
http://twitter.com/sqlabs



> On 17 Mar 2018, at 15:53, Philippe Riand  wrote:
> 
> We are using virtual tables to provide an SQL access to our data set and this 
> works very well.  But we have potentially "a lot” of virtual tables, with 
> some even yet unknown when we start the DB.  We’d like to create them lazily, 
> on first access.
> Is there a hook we can use so when an SQL statement refers to a non existing 
> table it asks a callback for a VT definition? It is fine if these dynamic 
> table requires a specific prefix similar to the "temp” one.
> 
> Regards,
> 
> Phil.
> 
> 
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Lazy virtual table creation

2018-03-17 Thread Richard Hipp
On 3/17/18, Philippe Riand  wrote:
> We are using virtual tables to provide an SQL access to our data set and
> this works very well.  But we have potentially "a lot” of virtual tables,
> with some even yet unknown when we start the DB.  We’d like to create them
> lazily, on first access.
> Is there a hook we can use so when an SQL statement refers to a non existing
> table it asks a callback for a VT definition? It is fine if these dynamic
> table requires a specific prefix similar to the "temp” one.

There is no such hook.  Sorry.

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Lazy virtual table creation

2018-03-17 Thread Philippe Riand
We are using virtual tables to provide an SQL access to our data set and this 
works very well.  But we have potentially "a lot” of virtual tables, with some 
even yet unknown when we start the DB.  We’d like to create them lazily, on 
first access.
Is there a hook we can use so when an SQL statement refers to a non existing 
table it asks a callback for a VT definition? It is fine if these dynamic table 
requires a specific prefix similar to the "temp” one.

Regards,

Phil.


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users