Skip to content

Commit 69ba7ce

Browse files
committed
Repo Reogranization
General - compatibility with newest kuzu version (Kuzu v.0.3.2) Examples - updated example code, added C# example for newest kuzu version - updated generated files in examples for newest kuzu version Readme - unified readme - added more detail and instruction to regarding the build process gitignore - excluded build files in wrapperlib since they are version specific - excluded kuzu files and generated files everywhere except for examples since they depend on the version you want to generate
1 parent 8ab502f commit 69ba7ce

File tree

316 files changed

+11833
-6979
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

316 files changed

+11833
-6979
lines changed

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#
2+
# Kuzu lib files (have to be inserted manually)
3+
#
4+
5+
KuzuFiles/*.h
6+
KuzuFiles/*.hpp
7+
KuzuFiles/*.dll
8+
KuzuFiles/*.lib
9+
10+
#
11+
# SWIG generated classes (have to be generated)
12+
#
13+
14+
KuzuFiles/generated_classes/**
15+
wrapperlib/kuzu_wrap.cpp
16+
17+
#
18+
# Cmake and build files
19+
#
20+
21+
wrapperlib/build/**
22+
23+
#
24+
# Visual studio files
25+
#
26+
27+
**/.vs/*
28+
29+
#
30+
# VS build files
31+
#
32+
33+
**/bin/*
34+
**/obj/*

KuzuDB-net/KuzuDB-TestAndExplore/bin/Debug/KuzuDB-TestAndExplorer.exe.config renamed to KuzuDB-net/ConsoleAppExample/App.config

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8" ?>
22
<configuration>
3-
<startup>
4-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
55
</startup>
6-
</configuration>
6+
</configuration>
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{079FC394-EAC1-4C84-9AFD-487EFB121741}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>ConsoleAppExample</RootNamespace>
10+
<AssemblyName>ConsoleAppExample</AssemblyName>
11+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
<Prefer32Bit>false</Prefer32Bit>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28+
<PlatformTarget>AnyCPU</PlatformTarget>
29+
<DebugType>pdbonly</DebugType>
30+
<Optimize>true</Optimize>
31+
<OutputPath>bin\Release\</OutputPath>
32+
<DefineConstants>TRACE</DefineConstants>
33+
<ErrorReport>prompt</ErrorReport>
34+
<WarningLevel>4</WarningLevel>
35+
</PropertyGroup>
36+
<ItemGroup>
37+
<Reference Include="System" />
38+
<Reference Include="System.Core" />
39+
<Reference Include="System.Xml.Linq" />
40+
<Reference Include="System.Data.DataSetExtensions" />
41+
<Reference Include="Microsoft.CSharp" />
42+
<Reference Include="System.Data" />
43+
<Reference Include="System.Net.Http" />
44+
<Reference Include="System.Xml" />
45+
</ItemGroup>
46+
<ItemGroup>
47+
<Compile Include="Program.cs" />
48+
<Compile Include="Properties\AssemblyInfo.cs" />
49+
</ItemGroup>
50+
<ItemGroup>
51+
<None Include="App.config" />
52+
<None Include="csv\cities.csv">
53+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
54+
</None>
55+
<None Include="csv\follows.csv">
56+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
57+
</None>
58+
<None Include="csv\lives-in.csv">
59+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
60+
</None>
61+
<None Include="csv\users.csv">
62+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
63+
</None>
64+
</ItemGroup>
65+
<ItemGroup>
66+
<ProjectReference Include="..\KuzuDB-Net\KuzuDB-Net.csproj">
67+
<Project>{fffc5493-3af3-403c-81ae-a4b7c0285dc8}</Project>
68+
<Name>KuzuDB-Net</Name>
69+
</ProjectReference>
70+
</ItemGroup>
71+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
72+
</Project>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// this simple console app demonstrates the usage of Kuzu v.0.3.2
2+
3+
using System;
4+
using static kuzunet;
5+
6+
namespace ConsoleAppExample
7+
{
8+
internal class Program
9+
{
10+
static void Main(string[] args)
11+
{
12+
kuzu_database db = kuzu_database_init("test", kuzu_default_system_config());
13+
kuzu_connection conn = kuzu_connection_init(db);
14+
15+
kuzu_query_result result;
16+
17+
result = kuzu_connection_query(conn, "CREATE NODE TABLE User(name STRING, age INT64, PRIMARY KEY (name))");
18+
kuzu_query_result_destroy(result);
19+
result = kuzu_connection_query(conn, "CREATE NODE TABLE City(name STRING, population INT64, PRIMARY KEY (name))");
20+
kuzu_query_result_destroy(result);
21+
result = kuzu_connection_query(conn, "CREATE REL TABLE Follows(FROM User TO User, since INT64)");
22+
kuzu_query_result_destroy(result);
23+
result = kuzu_connection_query(conn, "CREATE REL TABLE LivesIn(FROM User TO City)");
24+
kuzu_query_result_destroy(result);
25+
26+
result = kuzu_connection_query(conn, "COPY User FROM \"csv/users.csv\"");
27+
kuzu_query_result_destroy(result);
28+
result = kuzu_connection_query(conn, "COPY City FROM \"csv/cities.csv\"");
29+
kuzu_query_result_destroy(result);
30+
result = kuzu_connection_query(conn, "COPY Follows FROM \"csv/follows.csv\"");
31+
kuzu_query_result_destroy(result);
32+
result = kuzu_connection_query(conn, "COPY LivesIn FROM \"csv/lives.csv\"");
33+
kuzu_query_result_destroy(result);
34+
35+
result = kuzu_connection_query(conn, "MATCH (a:User)-[f:Follows]->(b:User) RETURN a.name, f.since, b.name;");
36+
37+
while (kuzu_query_result_has_next(result))
38+
{
39+
40+
kuzu_flat_tuple tuple = kuzu_query_result_get_next(result);
41+
kuzu_value value;
42+
43+
value = kuzu_flat_tuple_get_value(tuple, 0);
44+
String name = kuzu_value_get_string(value);
45+
kuzu_value_destroy(value);
46+
47+
value = kuzu_flat_tuple_get_value(tuple, 1);
48+
String since = kuzu_value_get_string(value);
49+
kuzu_value_destroy(value);
50+
51+
value = kuzu_flat_tuple_get_value(tuple, 2);
52+
String name2 = kuzu_value_get_string(value);
53+
kuzu_value_destroy(value);
54+
55+
Console.WriteLine(String.Format("{0} follows {1} since {2}", name, name2, since));
56+
kuzu_flat_tuple_destroy(tuple);
57+
}
58+
kuzu_query_result_destroy(result);
59+
kuzu_connection_destroy(conn);
60+
kuzu_database_destroy(db);
61+
62+
Console.WriteLine("Press enter to close...");
63+
Console.ReadLine();
64+
}
65+
}
66+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("ConsoleAppExample")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("ConsoleAppExample")]
13+
[assembly: AssemblyCopyright("Copyright © 2024")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("079fc394-eac1-4c84-9afd-487efb121741")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
File renamed without changes.

KuzuDB-net/KuzuDB-TestAndExplore/bin/x64/Debug/csvs/follows.csv renamed to KuzuDB-net/ConsoleAppExample/csv/follows.csv

File renamed without changes.

KuzuDB-net/KuzuDB-TestAndExplore/bin/x64/Debug/csvs/lives-in.csv renamed to KuzuDB-net/ConsoleAppExample/csv/lives-in.csv

File renamed without changes.
File renamed without changes.

KuzuDB-net/KuzuDB-Net/KuzuDB-Net.csproj

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>KuzuDB</RootNamespace>
1111
<AssemblyName>KuzuDB</AssemblyName>
12-
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<Deterministic>true</Deterministic>
1515
<TargetFrameworkProfile />
@@ -36,7 +36,7 @@
3636
<OutputPath>bin\x64\Debug\</OutputPath>
3737
<DefineConstants>DEBUG;TRACE</DefineConstants>
3838
<DebugType>full</DebugType>
39-
<PlatformTarget>x64</PlatformTarget>
39+
<PlatformTarget>AnyCPU</PlatformTarget>
4040
<LangVersion>7.3</LangVersion>
4141
<ErrorReport>prompt</ErrorReport>
4242
</PropertyGroup>
@@ -61,23 +61,38 @@
6161
</ItemGroup>
6262
<ItemGroup>
6363
<Compile Include="Properties\AssemblyInfo.cs" />
64+
<Compile Include="WrapperFiles\ArrowArray.cs" />
65+
<Compile Include="WrapperFiles\ArrowSchema.cs" />
6466
<Compile Include="WrapperFiles\kuzunet.cs" />
6567
<Compile Include="WrapperFiles\kuzunetPINVOKE.cs" />
6668
<Compile Include="WrapperFiles\kuzu_connection.cs" />
6769
<Compile Include="WrapperFiles\kuzu_database.cs" />
6870
<Compile Include="WrapperFiles\kuzu_data_type_id.cs" />
6971
<Compile Include="WrapperFiles\kuzu_date_t.cs" />
7072
<Compile Include="WrapperFiles\kuzu_flat_tuple.cs" />
73+
<Compile Include="WrapperFiles\kuzu_int128_t.cs" />
7174
<Compile Include="WrapperFiles\kuzu_internal_id_t.cs" />
7275
<Compile Include="WrapperFiles\kuzu_interval_t.cs" />
7376
<Compile Include="WrapperFiles\kuzu_logical_type.cs" />
74-
<Compile Include="WrapperFiles\kuzu_node_val.cs" />
7577
<Compile Include="WrapperFiles\kuzu_prepared_statement.cs" />
7678
<Compile Include="WrapperFiles\kuzu_query_result.cs" />
7779
<Compile Include="WrapperFiles\kuzu_query_summary.cs" />
78-
<Compile Include="WrapperFiles\kuzu_rel_val.cs" />
80+
<Compile Include="WrapperFiles\kuzu_system_config.cs" />
81+
<Compile Include="WrapperFiles\kuzu_timestamp_ms_t.cs" />
82+
<Compile Include="WrapperFiles\kuzu_timestamp_ns_t.cs" />
83+
<Compile Include="WrapperFiles\kuzu_timestamp_sec_t.cs" />
7984
<Compile Include="WrapperFiles\kuzu_timestamp_t.cs" />
85+
<Compile Include="WrapperFiles\kuzu_timestamp_tz_t.cs" />
8086
<Compile Include="WrapperFiles\kuzu_value.cs" />
87+
<Compile Include="WrapperFiles\SWIGTYPE_p_f_p_ArrowArray__void.cs" />
88+
<Compile Include="WrapperFiles\SWIGTYPE_p_f_p_ArrowSchema__void.cs" />
89+
<Compile Include="WrapperFiles\SWIGTYPE_p_int8_t.cs" />
90+
<Compile Include="WrapperFiles\SWIGTYPE_p_p_ArrowArray.cs" />
91+
<Compile Include="WrapperFiles\SWIGTYPE_p_p_ArrowSchema.cs" />
92+
<Compile Include="WrapperFiles\SWIGTYPE_p_p_void.cs" />
93+
<Compile Include="WrapperFiles\SWIGTYPE_p_uint16_t.cs" />
94+
<Compile Include="WrapperFiles\SWIGTYPE_p_uint32_t.cs" />
95+
<Compile Include="WrapperFiles\SWIGTYPE_p_uint8_t.cs" />
8196
<Compile Include="WrapperFiles\SWIGTYPE_p_void.cs" />
8297
</ItemGroup>
8398
<ItemGroup>

0 commit comments

Comments
 (0)