Skip to content

CrossDB
Ultra High-performance Lightweight Embedded and Server OLTP RDBMS✨

Quick Learn🧭 Benchmark 📜

  • 🌌 Simple


    CrossDB is easy to install and deploy, with zero external dependencies. It runs in-process within its host application with a tiny footprint.

    Read more

  • ♻️ Portable


    CrossDB runs on Linux, macOS, Windows, BSD, and all popular hardware architectures. It offers idiomatic client APIs for major programming languages.

    Read more

  • 🚀 Ultra Fast


    The hand-written SQL parser and memory-oriented design architecture enable the database to execute SQL at blazing speed.

    Read more

  • Hybrid Storage Mode


    CrossDB supports both On-Disk and In-Memory databases (IMDB). It can also operate in Hybrid mode, with some tables stored On-Disk and others In-Memory.

  • 🔱 SQL


    Most SQL statements are standard, and CrossDB also supports many extended statements from MySQL for convenient management.

    Read more

  • 💮 Server Mode


    In addition to the Embedded RDBMS mode, CrossDB can also operate in Embedded Server mode or as a Standalone RDBMS server.

    Read more



xdb_res_t   *pRes;
xdb_row_t   *pRow;

xdb_conn_t  *pConn = xdb_open (":memory:");
pRes = xdb_exec (pConn, "CREATE TABLE student (id INT PRIMARY KEY, name CHAR(16), age INT, class CHAR(16), score INT)");

pRes = xdb_exec (pConn, "INSERT INTO student (id,name,age,class,score) VALUES (1001,'Jack',10,'3-1',90),(1002,'Tom',11,'2-5',91),(1003,'David',11,'1-6',92),(1004,'Rose',10,'4-2',90),(1005,'Tim',10,'3-1',95)");
pRes = xdb_bexec (pConn, "INSERT INTO student (id,name,age,class,score) VALUES (?,?,?,?,?)", 1006, "Wendy", 10, "4-3", 99);

pRes = xdb_bexec (pConn, "SELECT * FROM student WHERE id = ?", 1001);
while (NULL != (pRow = xdb_fetch_row (pRes))) {
    xdb_print_row (pRes->row_meta, pRow);
    printf ("\n");
}
xdb_free_result (pRes);

pRes = xdb_bexec (pConn, "UPDATE student set age = age + ? WHERE id = ?", 2, id);
pRes = xdb_bexec (pConn, "DELETE FROM student WHERE id = ?", id);

xdb_close (pConn);
import crossdb

conn = crossdb.connect(database=":memory:")
cursor = conn.cursor()

cursor.execute("CREATE TABLE student (name CHAR(16), age INT, class CHAR(16))")
cursor.execute("INSERT INTO student (name,age,class) VALUES ('jack',10,'3-1'), ('tom',11,'2-5')")

cursor.execute("SELECT * FROM student")
for row in cursor:
    print (row)

cursor.close()
conn.close()
1
2
3
4
5
6
7
8
CREATE TABLE student (id INT, name CHAR(16), age INT, class CHAR(16), score INT);

INSERT INTO student (id,name,age,class,score) VALUES (1,'jack',10,'3-1',90),(2,'tom',11,'2-5',91),(3,'jack',11,'1-6',92),(4,'rose',10,'4-2',90),(5,'tim',10,'3-1',95);

SELECT * FROM student WHERE id = 1001;

UPDATE student set age = age + 2 WHERE id = 1002;
DELETE FROM student WHERE id = 1003;