Connection
A connection to one database, dbName.
A query and a transaction run through the same connection resolve table names differently, and nothing in the SQL text distinguishes the two.
A query may reach any attached database:
db.schema.table— that table, in that database.a.b— matched against both readings: schemaaof dbName, and tablebin thepublicschema of a databasea. It resolves to whichever exists, and is anAmbiguous table referencewhen both do. The database reading only reachespublic, so another schema of another database needs all three parts.b— tablebin thepublicschema of dbName.
A transaction resolves only its own database:
a.b— schemaaof that database, never a database. SoINSERT INTO other_db.foocreatesfooin schemaother_dbof the transaction's own database.b— tablebin thepublicschema of that database.A table in another database is unreachable, and referring to one reports that the table was not found, naming the transaction's database.
The transaction's database is:
dbName — for SQL DML through a Statement, and for a
BEGIN…COMMITblock. Neither can address another database.TxOpts.dbName, defaulting to dbName — for submitTx and executeTx.
The narrowing is deliberate: XTDB guarantees serializability within a database and not between databases, so a transaction that read across them would have no consistent basis to read at.
Constructors
Types
Properties
Functions
The transaction goes to TxOpts.dbName (default dbName) and may only refer to tables within it — see Connection.
The transaction goes to TxOpts.dbName (default dbName) and may only refer to tables within it — see Connection.