Connect to CrossDB¶
You need a connection instance to connect to CrossDB, and all operations will use this connection handle.
- Each thread can use only one connection, and each connection can be used by only one thread.
- All opened databases are shared among all opened connections, and you can use
USE DATABASE db_name
command to switch the connection's default database.
C APIs¶
- Open a connection
Note
User has to use OPEN DATABASE '[path/]db_name'
or CREATE DATABASE '[path/]db_name'
or USE DATABASE db_name
.
- Open a connection and create a default memory database if not exist
- Open a connection and create a on-disk database
school
if not exist as the default database