Re: [sqlite] [EXTERNAL] Virtual Tables xConnect Called When?

2019-07-25 Thread Richard Hipp
xConnect is called whenever SQLite rereads and reparses the database
schema, such as when opening a connection to an existing database.

On 7/25/19, Justin Olbrantz  wrote:
> The reason I asked the question is because for my virtual table which has a
> "backing store" (more precisely it needs to have CREATE VIRTUAL TABLE
> called to associate a loaded file with the table to be created via a table
> parameter), I have separate implementations for xCreate and xConnect.
> xCreate is working fine (in fact it's already handling queries properly),
> but I'm not seeing any calls to xConnect including in queries (as you
> suggest). So for a table with different xCreate and xConnect functions,
> when would xConnect be called?
>
> --
> Justin Olbrantz (Quantam)
> "Ardente veritate
> Urite mala mundi
> Ardente veritate
> Incendite tenebras mundi"
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
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


Re: [sqlite] [EXTERNAL] Virtual Tables xConnect Called When?

2019-07-25 Thread Justin Olbrantz
The reason I asked the question is because for my virtual table which has a
"backing store" (more precisely it needs to have CREATE VIRTUAL TABLE
called to associate a loaded file with the table to be created via a table
parameter), I have separate implementations for xCreate and xConnect.
xCreate is working fine (in fact it's already handling queries properly),
but I'm not seeing any calls to xConnect including in queries (as you
suggest). So for a table with different xCreate and xConnect functions,
when would xConnect be called?

-- 
Justin Olbrantz (Quantam)
"Ardente veritate
Urite mala mundi
Ardente veritate
Incendite tenebras mundi"
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [EXTERNAL] Virtual Tables xConnect Called When?

2019-07-24 Thread Hick Gunter
This assumes that there is some kind of backing store that needs to be created 
once (xCreate) but may be conncted to (xConnect) later.

CREATE VIRTUAL TABLE calls the xCreate function (and DROP TABLE will call 
xDestroy), whereas queries will call the xConnect function. IIRC connecting to 
an SQLite database may also call the xCreate function during initial parsing of 
the schema.

Think of xCreate/xConnect as like fopen() with or without the create flag set.

-Ursprüngliche Nachricht-
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von Justin Olbrantz
Gesendet: Donnerstag, 25. Juli 2019 02:58
An: sqlite-users@mailinglists.sqlite.org
Betreff: [EXTERNAL] [sqlite] Virtual Tables xConnect Called When?

The documentation says that "The difference is that xConnect is called to 
establish a new connection to an existing virtual table whereas xCreate is 
called to create a new virtual table from scratch." But this leaves me unclear 
on the circumstances where xConnect would be called (assuming I have a 
non-eponymous table). How would you create a new connection to an exiting 
virtual table?

--
Justin Olbrantz (Quantam)
"Ardente veritate
Urite mala mundi
Ardente veritate
Incendite tenebras mundi"
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___
 Gunter Hick | Software Engineer | Scientific Games International GmbH | 
Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 
1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users