Update wrapper to Kuzu v0.11.0.
This commit is contained in:
parent
0f58c5e565
commit
4f441cdbe4
11 changed files with 1370 additions and 95 deletions
9
.gitignore
vendored
Normal file
9
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
experiments/imdb/*
|
||||||
|
nimble.paths
|
||||||
|
config.nims
|
||||||
|
tmp/*
|
||||||
|
kuzu
|
||||||
|
nimcache/*
|
||||||
|
tests/*
|
||||||
|
testresults/*
|
||||||
|
|
||||||
|
|
@ -39,7 +39,7 @@ For more information about Kuzu itself, see its
|
||||||
|
|
||||||
$ nimble install kuzu
|
$ nimble install kuzu
|
||||||
|
|
||||||
The current version of this library is built for Kuzu v0.10.0.
|
The current version of this library is built for Kuzu v0.11.0.
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
|
||||||
2
USAGE.md
2
USAGE.md
|
|
@ -35,6 +35,7 @@ heavily on it. :-) Once there's a 1.0, this should be less chaotic.
|
||||||
| v0.8.2 | v0.1.0 |
|
| v0.8.2 | v0.1.0 |
|
||||||
| v0.9.0 | v0.2.0 |
|
| v0.9.0 | v0.2.0 |
|
||||||
| v0.10.0 | v0.4.0 |
|
| v0.10.0 | v0.4.0 |
|
||||||
|
| v0.11.0 | v0.5.0 |
|
||||||
|
|
||||||
You can use the `kuzuVersionCompatible()` function (along with the
|
You can use the `kuzuVersionCompatible()` function (along with the
|
||||||
`kuzuGetVersion()` and the `KUZU_VERSION` constant) to quickly check if things
|
`kuzuGetVersion()` and the `KUZU_VERSION` constant) to quickly check if things
|
||||||
|
|
@ -521,4 +522,3 @@ q = conn.query( "MATCH (d:Doot) RETURN d.data" )
|
||||||
|
|
||||||
var blob = q.getNext[0].toBlob #=> @[72, 101, 108, 108, 111, 33]
|
var blob = q.getNext[0].toBlob #=> @[72, 101, 108, 108, 111, 33]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import kuzu
|
||||||
const DB = "imdb"
|
const DB = "imdb"
|
||||||
const DOT = "imdb-results.dot"
|
const DOT = "imdb-results.dot"
|
||||||
|
|
||||||
if not DB.dirExists:
|
if not DB.fileExists:
|
||||||
echo """Cowardly refusing to run without an imdb database.
|
echo """Cowardly refusing to run without an imdb database.
|
||||||
(see: imdb_import in this directory.)"""
|
(see: imdb_import in this directory.)"""
|
||||||
quit 1
|
quit 1
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ requires "nim ^= 2.0.0"
|
||||||
#requires "zip ^= 0.3.1"
|
#requires "zip ^= 0.3.1"
|
||||||
|
|
||||||
task makewrapper, "Generate the C wrapper using Futhark":
|
task makewrapper, "Generate the C wrapper using Futhark":
|
||||||
exec "nim c -d:futharkWrap --outdir=. src/kuzu.nim"
|
exec "nim c -d:futharkWrap --outdir=tmp/ src/kuzu.nim"
|
||||||
|
|
||||||
task test, "Run the test suite.":
|
task test, "Run the test suite.":
|
||||||
exec "testament --megatest:off all"
|
exec "testament --megatest:off all"
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@ when defined( futharkWrap ):
|
||||||
import futhark, os
|
import futhark, os
|
||||||
|
|
||||||
importc:
|
importc:
|
||||||
outputPath currentSourcePath.parentDir / "kuzu" / "0.10.0.nim"
|
outputPath currentSourcePath.parentDir / "kuzu" / "0.11.0.nim"
|
||||||
"kuzu.h"
|
"kuzu.h"
|
||||||
else:
|
else:
|
||||||
include "kuzu/0.10.0.nim"
|
include "kuzu/0.11.0.nim"
|
||||||
|
|
||||||
import
|
import
|
||||||
std/strformat,
|
std/strformat,
|
||||||
|
|
|
||||||
|
|
@ -68,70 +68,70 @@ type
|
||||||
max_db_size*: uint64
|
max_db_size*: uint64
|
||||||
auto_checkpoint*: bool
|
auto_checkpoint*: bool
|
||||||
checkpoint_threshold*: uint64
|
checkpoint_threshold*: uint64
|
||||||
kuzu_system_config_570425787 = struct_kuzu_system_config_570425786 ## Generated based on /usr/include/kuzu.h:135:3
|
kuzu_system_config_570425787 = struct_kuzu_system_config_570425786 ## Generated based on /usr/include/kuzu.h:141:3
|
||||||
struct_kuzu_database_570425789 {.pure, inheritable, bycopy.} = object
|
struct_kuzu_database_570425789 {.pure, inheritable, bycopy.} = object
|
||||||
internal_database*: pointer ## Generated based on /usr/include/kuzu.h:140:9
|
internal_database*: pointer ## Generated based on /usr/include/kuzu.h:146:9
|
||||||
kuzu_database_570425791 = struct_kuzu_database_570425790 ## Generated based on /usr/include/kuzu.h:142:3
|
kuzu_database_570425791 = struct_kuzu_database_570425790 ## Generated based on /usr/include/kuzu.h:148:3
|
||||||
struct_kuzu_connection_570425793 {.pure, inheritable, bycopy.} = object
|
struct_kuzu_connection_570425793 {.pure, inheritable, bycopy.} = object
|
||||||
internal_connection*: pointer ## Generated based on /usr/include/kuzu.h:149:9
|
internal_connection*: pointer ## Generated based on /usr/include/kuzu.h:155:9
|
||||||
kuzu_connection_570425795 = struct_kuzu_connection_570425794 ## Generated based on /usr/include/kuzu.h:151:3
|
kuzu_connection_570425795 = struct_kuzu_connection_570425794 ## Generated based on /usr/include/kuzu.h:157:3
|
||||||
struct_kuzu_prepared_statement_570425797 {.pure, inheritable, bycopy.} = object
|
struct_kuzu_prepared_statement_570425797 {.pure, inheritable, bycopy.} = object
|
||||||
internal_prepared_statement*: pointer ## Generated based on /usr/include/kuzu.h:157:9
|
internal_prepared_statement*: pointer ## Generated based on /usr/include/kuzu.h:163:9
|
||||||
internal_bound_values*: pointer
|
internal_bound_values*: pointer
|
||||||
kuzu_prepared_statement_570425799 = struct_kuzu_prepared_statement_570425798 ## Generated based on /usr/include/kuzu.h:160:3
|
kuzu_prepared_statement_570425799 = struct_kuzu_prepared_statement_570425798 ## Generated based on /usr/include/kuzu.h:166:3
|
||||||
struct_kuzu_query_result_570425801 {.pure, inheritable, bycopy.} = object
|
struct_kuzu_query_result_570425801 {.pure, inheritable, bycopy.} = object
|
||||||
internal_query_result*: pointer ## Generated based on /usr/include/kuzu.h:165:9
|
internal_query_result*: pointer ## Generated based on /usr/include/kuzu.h:171:9
|
||||||
internal_is_owned_by_cpp*: bool
|
internal_is_owned_by_cpp*: bool
|
||||||
kuzu_query_result_570425803 = struct_kuzu_query_result_570425802 ## Generated based on /usr/include/kuzu.h:168:3
|
kuzu_query_result_570425803 = struct_kuzu_query_result_570425802 ## Generated based on /usr/include/kuzu.h:174:3
|
||||||
struct_kuzu_flat_tuple_570425805 {.pure, inheritable, bycopy.} = object
|
struct_kuzu_flat_tuple_570425805 {.pure, inheritable, bycopy.} = object
|
||||||
internal_flat_tuple*: pointer ## Generated based on /usr/include/kuzu.h:173:9
|
internal_flat_tuple*: pointer ## Generated based on /usr/include/kuzu.h:179:9
|
||||||
internal_is_owned_by_cpp*: bool
|
internal_is_owned_by_cpp*: bool
|
||||||
kuzu_flat_tuple_570425807 = struct_kuzu_flat_tuple_570425806 ## Generated based on /usr/include/kuzu.h:176:3
|
kuzu_flat_tuple_570425807 = struct_kuzu_flat_tuple_570425806 ## Generated based on /usr/include/kuzu.h:182:3
|
||||||
struct_kuzu_logical_type_570425809 {.pure, inheritable, bycopy.} = object
|
struct_kuzu_logical_type_570425809 {.pure, inheritable, bycopy.} = object
|
||||||
internal_data_type*: pointer ## Generated based on /usr/include/kuzu.h:181:9
|
internal_data_type*: pointer ## Generated based on /usr/include/kuzu.h:187:9
|
||||||
kuzu_logical_type_570425811 = struct_kuzu_logical_type_570425810 ## Generated based on /usr/include/kuzu.h:183:3
|
kuzu_logical_type_570425811 = struct_kuzu_logical_type_570425810 ## Generated based on /usr/include/kuzu.h:189:3
|
||||||
struct_kuzu_value_570425813 {.pure, inheritable, bycopy.} = object
|
struct_kuzu_value_570425813 {.pure, inheritable, bycopy.} = object
|
||||||
internal_value*: pointer ## Generated based on /usr/include/kuzu.h:188:9
|
internal_value*: pointer ## Generated based on /usr/include/kuzu.h:194:9
|
||||||
internal_is_owned_by_cpp*: bool
|
internal_is_owned_by_cpp*: bool
|
||||||
kuzu_value_570425815 = struct_kuzu_value_570425814 ## Generated based on /usr/include/kuzu.h:191:3
|
kuzu_value_570425815 = struct_kuzu_value_570425814 ## Generated based on /usr/include/kuzu.h:197:3
|
||||||
struct_kuzu_internal_id_t_570425817 {.pure, inheritable, bycopy.} = object
|
struct_kuzu_internal_id_t_570425817 {.pure, inheritable, bycopy.} = object
|
||||||
table_id*: uint64 ## Generated based on /usr/include/kuzu.h:196:9
|
table_id*: uint64 ## Generated based on /usr/include/kuzu.h:202:9
|
||||||
offset*: uint64
|
offset*: uint64
|
||||||
kuzu_internal_id_t_570425819 = struct_kuzu_internal_id_t_570425818 ## Generated based on /usr/include/kuzu.h:199:3
|
kuzu_internal_id_t_570425819 = struct_kuzu_internal_id_t_570425818 ## Generated based on /usr/include/kuzu.h:205:3
|
||||||
struct_kuzu_date_t_570425821 {.pure, inheritable, bycopy.} = object
|
struct_kuzu_date_t_570425821 {.pure, inheritable, bycopy.} = object
|
||||||
days*: int32 ## Generated based on /usr/include/kuzu.h:204:9
|
days*: int32 ## Generated based on /usr/include/kuzu.h:210:9
|
||||||
kuzu_date_t_570425823 = struct_kuzu_date_t_570425822 ## Generated based on /usr/include/kuzu.h:207:3
|
kuzu_date_t_570425823 = struct_kuzu_date_t_570425822 ## Generated based on /usr/include/kuzu.h:213:3
|
||||||
struct_kuzu_timestamp_ns_t_570425825 {.pure, inheritable, bycopy.} = object
|
struct_kuzu_timestamp_ns_t_570425825 {.pure, inheritable, bycopy.} = object
|
||||||
value*: int64 ## Generated based on /usr/include/kuzu.h:213:9
|
value*: int64 ## Generated based on /usr/include/kuzu.h:219:9
|
||||||
kuzu_timestamp_ns_t_570425827 = struct_kuzu_timestamp_ns_t_570425826 ## Generated based on /usr/include/kuzu.h:216:3
|
kuzu_timestamp_ns_t_570425827 = struct_kuzu_timestamp_ns_t_570425826 ## Generated based on /usr/include/kuzu.h:222:3
|
||||||
struct_kuzu_timestamp_ms_t_570425829 {.pure, inheritable, bycopy.} = object
|
struct_kuzu_timestamp_ms_t_570425829 {.pure, inheritable, bycopy.} = object
|
||||||
value*: int64 ## Generated based on /usr/include/kuzu.h:222:9
|
value*: int64 ## Generated based on /usr/include/kuzu.h:228:9
|
||||||
kuzu_timestamp_ms_t_570425831 = struct_kuzu_timestamp_ms_t_570425830 ## Generated based on /usr/include/kuzu.h:225:3
|
kuzu_timestamp_ms_t_570425831 = struct_kuzu_timestamp_ms_t_570425830 ## Generated based on /usr/include/kuzu.h:231:3
|
||||||
struct_kuzu_timestamp_sec_t_570425833 {.pure, inheritable, bycopy.} = object
|
struct_kuzu_timestamp_sec_t_570425833 {.pure, inheritable, bycopy.} = object
|
||||||
value*: int64 ## Generated based on /usr/include/kuzu.h:231:9
|
value*: int64 ## Generated based on /usr/include/kuzu.h:237:9
|
||||||
kuzu_timestamp_sec_t_570425835 = struct_kuzu_timestamp_sec_t_570425834 ## Generated based on /usr/include/kuzu.h:234:3
|
kuzu_timestamp_sec_t_570425835 = struct_kuzu_timestamp_sec_t_570425834 ## Generated based on /usr/include/kuzu.h:240:3
|
||||||
struct_kuzu_timestamp_tz_t_570425837 {.pure, inheritable, bycopy.} = object
|
struct_kuzu_timestamp_tz_t_570425837 {.pure, inheritable, bycopy.} = object
|
||||||
value*: int64 ## Generated based on /usr/include/kuzu.h:240:9
|
value*: int64 ## Generated based on /usr/include/kuzu.h:246:9
|
||||||
kuzu_timestamp_tz_t_570425839 = struct_kuzu_timestamp_tz_t_570425838 ## Generated based on /usr/include/kuzu.h:243:3
|
kuzu_timestamp_tz_t_570425839 = struct_kuzu_timestamp_tz_t_570425838 ## Generated based on /usr/include/kuzu.h:249:3
|
||||||
struct_kuzu_timestamp_t_570425841 {.pure, inheritable, bycopy.} = object
|
struct_kuzu_timestamp_t_570425841 {.pure, inheritable, bycopy.} = object
|
||||||
value*: int64 ## Generated based on /usr/include/kuzu.h:249:9
|
value*: int64 ## Generated based on /usr/include/kuzu.h:255:9
|
||||||
kuzu_timestamp_t_570425843 = struct_kuzu_timestamp_t_570425842 ## Generated based on /usr/include/kuzu.h:252:3
|
kuzu_timestamp_t_570425843 = struct_kuzu_timestamp_t_570425842 ## Generated based on /usr/include/kuzu.h:258:3
|
||||||
struct_kuzu_interval_t_570425845 {.pure, inheritable, bycopy.} = object
|
struct_kuzu_interval_t_570425845 {.pure, inheritable, bycopy.} = object
|
||||||
months*: int32 ## Generated based on /usr/include/kuzu.h:257:9
|
months*: int32 ## Generated based on /usr/include/kuzu.h:263:9
|
||||||
days*: int32
|
days*: int32
|
||||||
micros*: int64
|
micros*: int64
|
||||||
kuzu_interval_t_570425847 = struct_kuzu_interval_t_570425846 ## Generated based on /usr/include/kuzu.h:261:3
|
kuzu_interval_t_570425847 = struct_kuzu_interval_t_570425846 ## Generated based on /usr/include/kuzu.h:267:3
|
||||||
struct_kuzu_query_summary_570425849 {.pure, inheritable, bycopy.} = object
|
struct_kuzu_query_summary_570425849 {.pure, inheritable, bycopy.} = object
|
||||||
internal_query_summary*: pointer ## Generated based on /usr/include/kuzu.h:267:9
|
internal_query_summary*: pointer ## Generated based on /usr/include/kuzu.h:273:9
|
||||||
kuzu_query_summary_570425851 = struct_kuzu_query_summary_570425850 ## Generated based on /usr/include/kuzu.h:269:3
|
kuzu_query_summary_570425851 = struct_kuzu_query_summary_570425850 ## Generated based on /usr/include/kuzu.h:275:3
|
||||||
struct_kuzu_int128_t_570425853 {.pure, inheritable, bycopy.} = object
|
struct_kuzu_int128_t_570425853 {.pure, inheritable, bycopy.} = object
|
||||||
low*: uint64 ## Generated based on /usr/include/kuzu.h:271:9
|
low*: uint64 ## Generated based on /usr/include/kuzu.h:277:9
|
||||||
high*: int64
|
high*: int64
|
||||||
kuzu_int128_t_570425855 = struct_kuzu_int128_t_570425854 ## Generated based on /usr/include/kuzu.h:274:3
|
kuzu_int128_t_570425855 = struct_kuzu_int128_t_570425854 ## Generated based on /usr/include/kuzu.h:280:3
|
||||||
kuzu_data_type_id_570425859 = enum_kuzu_data_type_id_570425858 ## Generated based on /usr/include/kuzu.h:319:3
|
kuzu_data_type_id_570425859 = enum_kuzu_data_type_id_570425858 ## Generated based on /usr/include/kuzu.h:325:3
|
||||||
kuzu_state_570425863 = enum_kuzu_state_570425862 ## Generated based on /usr/include/kuzu.h:324:49
|
kuzu_state_570425863 = enum_kuzu_state_570425862 ## Generated based on /usr/include/kuzu.h:330:49
|
||||||
struct_tm_570425865 {.pure, inheritable, bycopy.} = object
|
struct_tm_570425865 {.pure, inheritable, bycopy.} = object
|
||||||
tm_sec*: cint ## Generated based on /usr/include/x86_64-linux-gnu/bits/types/struct_tm.h:7:8
|
tm_sec*: cint ## Generated based on /usr/include/bits/types/struct_tm.h:7:8
|
||||||
tm_min*: cint
|
tm_min*: cint
|
||||||
tm_hour*: cint
|
tm_hour*: cint
|
||||||
tm_mday*: cint
|
tm_mday*: cint
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# vim: set et sta sw=4 ts=4 :
|
# vim: set et sta sw=4 ts=4 :
|
||||||
|
|
||||||
const KUZU_VERSION* = "0.4.0"
|
const KUZU_VERSION* = "0.5.0"
|
||||||
const KUZU_EXPECTED_LIBVERSION* = "0.10.0"
|
const KUZU_EXPECTED_LIBVERSION* = "0.11.0"
|
||||||
const BLOB_MAXSIZE = 4096
|
const BLOB_MAXSIZE = 4096
|
||||||
|
|
||||||
let KUZU_DEFAULT_CONFIG* = kuzu_default_system_config()
|
let KUZU_DEFAULT_CONFIG* = kuzu_default_system_config()
|
||||||
|
|
|
||||||
1266
testresults.html
Normal file
1266
testresults.html
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,17 +1,17 @@
|
||||||
# vim: set et sta sw=4 ts=4 :
|
# vim: set et sta sw=4 ts=4 :
|
||||||
|
|
||||||
import
|
import
|
||||||
std/dirs,
|
std/files,
|
||||||
std/paths
|
std/paths
|
||||||
|
|
||||||
import kuzu
|
import kuzu
|
||||||
|
|
||||||
const DATABASE_PATH = Path( "tmp/testdb" )
|
const DATABASE_PATH = Path( "tmp/testdb" )
|
||||||
DATABASE_PATH.removeDir()
|
DATABASE_PATH.removeFile()
|
||||||
|
|
||||||
var db = newKuzuDatabase( $DATABASE_PATH, kuzuConfig( auto_checkpoint=false ) )
|
var db = newKuzuDatabase( $DATABASE_PATH, kuzuConfig( auto_checkpoint=false ) )
|
||||||
assert db.path == "tmp/testdb"
|
assert db.path == "tmp/testdb"
|
||||||
assert db.config.auto_checkpoint == false
|
assert db.config.auto_checkpoint == false
|
||||||
|
|
||||||
DATABASE_PATH.removeDir()
|
DATABASE_PATH.removeFile()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
# vim: set et sta sw=4 ts=4 :
|
# vim: set et sta sw=4 ts=4 :
|
||||||
|
|
||||||
import
|
import
|
||||||
std/dirs,
|
std/files,
|
||||||
std/paths
|
std/paths
|
||||||
|
|
||||||
import kuzu
|
import kuzu
|
||||||
|
|
||||||
const DATABASE_PATH = Path( "tmp/testdb" )
|
const DATABASE_PATH = Path( "tmp/testdb" )
|
||||||
|
|
||||||
DATABASE_PATH.removeDir()
|
DATABASE_PATH.removeFile()
|
||||||
var db = newKuzuDatabase( $DATABASE_PATH )
|
var db = newKuzuDatabase( $DATABASE_PATH )
|
||||||
|
|
||||||
assert db.path == $DATABASE_PATH
|
assert db.path == $DATABASE_PATH
|
||||||
assert db.config == kuzuConfig()
|
assert db.config == kuzuConfig()
|
||||||
assert db.config.read_only == false
|
assert db.config.read_only == false
|
||||||
|
|
||||||
DATABASE_PATH.removeDir()
|
DATABASE_PATH.removeFile()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue