Skip to content

Commit

Permalink
Repo Reogranization
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Blubberblub committed Apr 29, 2024
1 parent 8ab502f commit 69ba7ce
Show file tree
Hide file tree
Showing 316 changed files with 11,833 additions and 6,979 deletions.
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# Kuzu lib files (have to be inserted manually)
#

KuzuFiles/*.h
KuzuFiles/*.hpp
KuzuFiles/*.dll
KuzuFiles/*.lib

#
# SWIG generated classes (have to be generated)
#

KuzuFiles/generated_classes/**
wrapperlib/kuzu_wrap.cpp

#
# Cmake and build files
#

wrapperlib/build/**

#
# Visual studio files
#

**/.vs/*

#
# VS build files
#

**/bin/*
**/obj/*
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>
</configuration>
72 changes: 72 additions & 0 deletions KuzuDB-net/ConsoleAppExample/ConsoleAppExample.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{079FC394-EAC1-4C84-9AFD-487EFB121741}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>ConsoleAppExample</RootNamespace>
<AssemblyName>ConsoleAppExample</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="csv\cities.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="csv\follows.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="csv\lives-in.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="csv\users.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\KuzuDB-Net\KuzuDB-Net.csproj">
<Project>{fffc5493-3af3-403c-81ae-a4b7c0285dc8}</Project>
<Name>KuzuDB-Net</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
66 changes: 66 additions & 0 deletions KuzuDB-net/ConsoleAppExample/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// this simple console app demonstrates the usage of Kuzu v.0.3.2

using System;
using static kuzunet;

namespace ConsoleAppExample
{
internal class Program
{
static void Main(string[] args)
{
kuzu_database db = kuzu_database_init("test", kuzu_default_system_config());
kuzu_connection conn = kuzu_connection_init(db);

kuzu_query_result result;

result = kuzu_connection_query(conn, "CREATE NODE TABLE User(name STRING, age INT64, PRIMARY KEY (name))");
kuzu_query_result_destroy(result);
result = kuzu_connection_query(conn, "CREATE NODE TABLE City(name STRING, population INT64, PRIMARY KEY (name))");
kuzu_query_result_destroy(result);
result = kuzu_connection_query(conn, "CREATE REL TABLE Follows(FROM User TO User, since INT64)");
kuzu_query_result_destroy(result);
result = kuzu_connection_query(conn, "CREATE REL TABLE LivesIn(FROM User TO City)");
kuzu_query_result_destroy(result);

result = kuzu_connection_query(conn, "COPY User FROM \"csv/users.csv\"");
kuzu_query_result_destroy(result);
result = kuzu_connection_query(conn, "COPY City FROM \"csv/cities.csv\"");
kuzu_query_result_destroy(result);
result = kuzu_connection_query(conn, "COPY Follows FROM \"csv/follows.csv\"");
kuzu_query_result_destroy(result);
result = kuzu_connection_query(conn, "COPY LivesIn FROM \"csv/lives.csv\"");
kuzu_query_result_destroy(result);

result = kuzu_connection_query(conn, "MATCH (a:User)-[f:Follows]->(b:User) RETURN a.name, f.since, b.name;");

while (kuzu_query_result_has_next(result))
{

kuzu_flat_tuple tuple = kuzu_query_result_get_next(result);
kuzu_value value;

value = kuzu_flat_tuple_get_value(tuple, 0);
String name = kuzu_value_get_string(value);
kuzu_value_destroy(value);

value = kuzu_flat_tuple_get_value(tuple, 1);
String since = kuzu_value_get_string(value);
kuzu_value_destroy(value);

value = kuzu_flat_tuple_get_value(tuple, 2);
String name2 = kuzu_value_get_string(value);
kuzu_value_destroy(value);

Console.WriteLine(String.Format("{0} follows {1} since {2}", name, name2, since));
kuzu_flat_tuple_destroy(tuple);
}
kuzu_query_result_destroy(result);
kuzu_connection_destroy(conn);
kuzu_database_destroy(db);

Console.WriteLine("Press enter to close...");
Console.ReadLine();
}
}
}
36 changes: 36 additions & 0 deletions KuzuDB-net/ConsoleAppExample/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ConsoleAppExample")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ConsoleAppExample")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("079fc394-eac1-4c84-9afd-487efb121741")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
File renamed without changes.
File renamed without changes.
23 changes: 19 additions & 4 deletions KuzuDB-net/KuzuDB-Net/KuzuDB-Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>KuzuDB</RootNamespace>
<AssemblyName>KuzuDB</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
Expand All @@ -36,7 +36,7 @@
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
Expand All @@ -61,23 +61,38 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WrapperFiles\ArrowArray.cs" />
<Compile Include="WrapperFiles\ArrowSchema.cs" />
<Compile Include="WrapperFiles\kuzunet.cs" />
<Compile Include="WrapperFiles\kuzunetPINVOKE.cs" />
<Compile Include="WrapperFiles\kuzu_connection.cs" />
<Compile Include="WrapperFiles\kuzu_database.cs" />
<Compile Include="WrapperFiles\kuzu_data_type_id.cs" />
<Compile Include="WrapperFiles\kuzu_date_t.cs" />
<Compile Include="WrapperFiles\kuzu_flat_tuple.cs" />
<Compile Include="WrapperFiles\kuzu_int128_t.cs" />
<Compile Include="WrapperFiles\kuzu_internal_id_t.cs" />
<Compile Include="WrapperFiles\kuzu_interval_t.cs" />
<Compile Include="WrapperFiles\kuzu_logical_type.cs" />
<Compile Include="WrapperFiles\kuzu_node_val.cs" />
<Compile Include="WrapperFiles\kuzu_prepared_statement.cs" />
<Compile Include="WrapperFiles\kuzu_query_result.cs" />
<Compile Include="WrapperFiles\kuzu_query_summary.cs" />
<Compile Include="WrapperFiles\kuzu_rel_val.cs" />
<Compile Include="WrapperFiles\kuzu_system_config.cs" />
<Compile Include="WrapperFiles\kuzu_timestamp_ms_t.cs" />
<Compile Include="WrapperFiles\kuzu_timestamp_ns_t.cs" />
<Compile Include="WrapperFiles\kuzu_timestamp_sec_t.cs" />
<Compile Include="WrapperFiles\kuzu_timestamp_t.cs" />
<Compile Include="WrapperFiles\kuzu_timestamp_tz_t.cs" />
<Compile Include="WrapperFiles\kuzu_value.cs" />
<Compile Include="WrapperFiles\SWIGTYPE_p_f_p_ArrowArray__void.cs" />
<Compile Include="WrapperFiles\SWIGTYPE_p_f_p_ArrowSchema__void.cs" />
<Compile Include="WrapperFiles\SWIGTYPE_p_int8_t.cs" />
<Compile Include="WrapperFiles\SWIGTYPE_p_p_ArrowArray.cs" />
<Compile Include="WrapperFiles\SWIGTYPE_p_p_ArrowSchema.cs" />
<Compile Include="WrapperFiles\SWIGTYPE_p_p_void.cs" />
<Compile Include="WrapperFiles\SWIGTYPE_p_uint16_t.cs" />
<Compile Include="WrapperFiles\SWIGTYPE_p_uint32_t.cs" />
<Compile Include="WrapperFiles\SWIGTYPE_p_uint8_t.cs" />
<Compile Include="WrapperFiles\SWIGTYPE_p_void.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
Loading

0 comments on commit 69ba7ce

Please sign in to comment.