From 87c1ee20fd9b15961e25102cdfc489b5dd27e8f3 Mon Sep 17 00:00:00 2001 From: Giorgi Dalakishvili Date: Wed, 20 Nov 2024 01:42:49 +0400 Subject: [PATCH] Added project for testing Aot --- AotTestApp/AotTestApp.csproj | 30 ++++++++++++++++++++++++++++++ AotTestApp/Program.cs | 34 ++++++++++++++++++++++++++++++++++ DuckDB.NET.sln | 6 ++++++ 3 files changed, 70 insertions(+) create mode 100644 AotTestApp/AotTestApp.csproj create mode 100644 AotTestApp/Program.cs diff --git a/AotTestApp/AotTestApp.csproj b/AotTestApp/AotTestApp.csproj new file mode 100644 index 00000000..e09049e8 --- /dev/null +++ b/AotTestApp/AotTestApp.csproj @@ -0,0 +1,30 @@ + + + + Exe + net8.0 + net8.0 + enable + enable + true + true + + + + Full + + + + + + + + + + + + + + + + diff --git a/AotTestApp/Program.cs b/AotTestApp/Program.cs new file mode 100644 index 00000000..ede76ae5 --- /dev/null +++ b/AotTestApp/Program.cs @@ -0,0 +1,34 @@ +using DuckDB.NET.Data; + +namespace AotTestApp; + +internal class Program +{ + static void Main(string[] args) + { + using (var cn = new DuckDBConnection(DuckDBConnectionStringBuilder.InMemoryConnectionString)) + { + cn.Open(); + using var duckDBCommand = cn.CreateCommand(); + duckDBCommand.CommandText = "Select struct from test_all_types()"; + + using var reader = duckDBCommand.ExecuteReader(); + while (reader.Read()) + { + if (!reader.IsDBNull(0)) + { + var structTest = reader.GetFieldValue(0); + Console.WriteLine($"A: {structTest.A}, B: {structTest.B?.Length}"); + } + } + } + + Console.ReadKey(); + } +} + +class StructTest +{ + public int? A { get; set; } + public string B { get; set; } +} \ No newline at end of file diff --git a/DuckDB.NET.sln b/DuckDB.NET.sln index 6c38102d..f36d8b8f 100644 --- a/DuckDB.NET.sln +++ b/DuckDB.NET.sln @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Data", "DuckDB.NET.Data\Dat EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test", "DuckDB.NET.Test\Test.csproj", "{56C63520-26F9-4230-9AD1-04457E5EBF57}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AotTestApp", "AotTestApp\AotTestApp.csproj", "{3A004ADD-6393-4099-A582-72E25269CA92}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -33,6 +35,10 @@ Global {56C63520-26F9-4230-9AD1-04457E5EBF57}.Debug|Any CPU.Build.0 = Debug|Any CPU {56C63520-26F9-4230-9AD1-04457E5EBF57}.Release|Any CPU.ActiveCfg = Release|Any CPU {56C63520-26F9-4230-9AD1-04457E5EBF57}.Release|Any CPU.Build.0 = Release|Any CPU + {3A004ADD-6393-4099-A582-72E25269CA92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3A004ADD-6393-4099-A582-72E25269CA92}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3A004ADD-6393-4099-A582-72E25269CA92}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3A004ADD-6393-4099-A582-72E25269CA92}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE