Virtual Tables xConnect Called When?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Virtual Tables xConnect Called When?

Justin Olbrantz
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
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: [EXTERNAL] Virtual Tables xConnect Called When?

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:[hidden email]] Im Auftrag von Justin Olbrantz
Gesendet: Donnerstag, 25. Juli 2019 02:58
An: [hidden email]
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
[hidden email]
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
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users