Get Started¶
Download¶
Choose the OS and CPU, then Download here.
Linux/FreeBSD package file list
File | Descritpion |
---|---|
crossdb.h | The only header file |
libcrossdb.so | The only shared library |
crossdb-cli | CrossDB command line tool |
examples/ | CrossDB example code |
Windows package file list
File | Descritpion |
---|---|
crossdb.h | The only header file |
crossdb.dll | The only shared library |
crossdb.lib | For build with MSCV compiler |
crossdb-cli.exe | CrossDB command line tool |
examples/ | CrossDB example code |
MacOS package file list
File | Descritpion |
---|---|
crossdb.h | The only header file |
libcrossdb.dylib | The only shared library for X64 and AMD64 |
crossdb-cli | CrossDB command line tool |
examples/ | CrossDB example code |
Linux/FreeBSD¶
Run Examples¶
Build in your project¶
-
You can check examples/build.sh to build the library in your project folder.
-
Yo can also install CrossDB globally and use it as common library.
1. Install
libcrossdb.so
to/usr/lib
2. Build this way:
gcc my.c -lcrossdb -pthread -ldl
Windows¶
Run Examples with MSVC¶
Start Visual Studio
command line from menu x64 Native Tools Command Prompt for VS 20xx
Enter CrossDB package folder
Run Examples with MINGW64¶
Note
You can run in git bash
or MSYS2 MINGW64
If you only have MINGW64, you an run in commandline
gcc -o example.exe -Wall -O2 example.c -I.. crossdb.dll
Build in your project¶
- For
MINGW64
, you can just usecrossdb.h
andcrossdb.dll
to compile. - For
Visual Studio
, You can addcrossdb.h
crossdb.lib
andcrossdb.dll
to your project.
MacOS¶
Run Examples¶
Build in your project¶
-
You can check examples/build.sh to build the library in your project folder.
-
Yo can also install CrossDB globally and use it as common library.
1. Install
libcrossdb.dylib
to/usr/local/lib
2. Build this way:
clang my.c -lcrossdb
Use CrossDB CLI¶
../crossdb-cli db_data
CrossDB> insert into route set prefix=1.1.1.1 mask=24 nexthop=1.1.1.254 metric=5 intf='eth1'
CrossDB> select * from route
ID prefix mask nexthop metric intf birth flags
== ======= ==== ========= ====== ==== =================== =====
1 1.1.1.1 24 1.1.1.254 5 eth1 1970-01-01T08:00:00 0x0
Qualified Rows: 1 Select Rows: 1 Use time 2us QPS 500000
More commands can be found here