コード例 #1
0
        public void Close_WhenConnectionStringNotProvided_ClosesInMemoryDatabase()
        {
            var dbConnection = new DuckDbConnection();

            dbConnection.Open();
            dbConnection.Close();
        }
コード例 #2
0
        private void CleanupConnection(DuckDbConnection connection)
        {
            var builder = DuckDbConnectionStringBuilder.Parse(connection.ConnectionString);

            File.Delete(builder.File);
            File.Delete(builder.File + ".wal");
        }
コード例 #3
0
        public void Open_WhenOtherInMemoryConnectionOpened_OpensInMemoryDatabase()
        {
            var dbConnection1 = new DuckDbConnection();
            var dbConnection2 = new DuckDbConnection();

            dbConnection1.Open();
            dbConnection2.Open();
        }
コード例 #4
0
ファイル: CommandTests.cs プロジェクト: x2bool/duckdb-net
        public void ExecuteScalar_Always_ExecutesCommand()
        {
            var dbConnection = new DuckDbConnection();

            dbConnection.Open();

            try
            {
                using var command = new DuckDbCommand("SELECT 1;", dbConnection);
                command.ExecuteScalar();
            }
            finally
            {
                dbConnection.Close();
            }
        }
コード例 #5
0
        private DuckDbConnection DuplicateConnection(DuckDbConnection connection)
        {
            var builder = DuckDbConnectionStringBuilder.Parse(connection.ConnectionString);

            return(new DuckDbConnection($"File={builder.File}"));
        }