public void Close_WhenConnectionStringNotProvided_ClosesInMemoryDatabase() { var dbConnection = new DuckDbConnection(); dbConnection.Open(); dbConnection.Close(); }
private void CleanupConnection(DuckDbConnection connection) { var builder = DuckDbConnectionStringBuilder.Parse(connection.ConnectionString); File.Delete(builder.File); File.Delete(builder.File + ".wal"); }
public void Open_WhenOtherInMemoryConnectionOpened_OpensInMemoryDatabase() { var dbConnection1 = new DuckDbConnection(); var dbConnection2 = new DuckDbConnection(); dbConnection1.Open(); dbConnection2.Open(); }
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(); } }
private DuckDbConnection DuplicateConnection(DuckDbConnection connection) { var builder = DuckDbConnectionStringBuilder.Parse(connection.ConnectionString); return(new DuckDbConnection($"File={builder.File}")); }