diff --git a/.env b/.env index 4cef26d4..112d6f85 100644 --- a/.env +++ b/.env @@ -1,8 +1,14 @@ SOURCE_WASM_FILE_UBUNTU="WasmRunner/obj/release/net8.0/wasi-wasm/wasm/for-publish/WasmRunner.wasm" SOURCE_WASM_FILE="WasmRunner/bin/Release/net8.0/wasi-wasm/AppBundle/WasmRunner.wasm" + +SQLITE_CONNECTION_STRING="Data Source=tests.db;Mode=ReadWrite" MYSQL_CONNECTION_STRING="server=localhost;database=tests;user=root;AllowLoadLocalInfile=true;ConvertZeroDateTime=True" POSTGRES_CONNECTION_STRING="host=localhost;database=tests;username=postgres;password=pass;IncludeErrorDetail=true" + +SQLITE_BENCHMARK_CONNECTION_STRING="Data Source=benchmark.db;Mode=ReadWrite" +MYSQL_BENCHMARK_CONNECTION_STRING="server=localhost;database=sales;user=root;AllowLoadLocalInfile=true;ConvertZeroDateTime=True" +POSTGRES_BENCHMARK_CONNECTION_STRING="host=localhost;database=tests;username=postgres;password=pass;IncludeErrorDetail=true" + POSTGRES_USER="postgres" POSTGRES_PASSWORD="pass" -TESTS_DB="tests" -SQLITE_CONNECTION_STRING="Data Source=tests.db;Mode=ReadWriteCreate" \ No newline at end of file +TESTS_DB="tests" \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 00000000..77670280 --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,260 @@ +name: Performance Benchmarks +defaults: + run: + shell: bash + +permissions: + contents: write + pull-requests: write + +env: + DOTNET_VERSION: '8.0.x' + +on: + release: + types: [ published ] + workflow_dispatch: + +jobs: + benchmark-mysql-reads: + name: MySQL Reads Benchmark + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Load .env file + uses: xom9ikk/dotenv@v2.3.0 + with: + load-mode: strict + + - name: Docker compose + uses: hoverkraft-tech/compose-action@v1.5.1 + with: + services: mysqldb + + - name: Run Benchmark + run: ./benchmark/scripts/run_single_benchmark.sh mysql reads + + - name: Upload Results + uses: actions/upload-artifact@v4 + if: success() + with: + name: mysql-reads-results + path: benchmark/BenchmarkDotNet.Artifacts/mysql/reads + + benchmark-mysql-writes: + name: MySQL Writes Benchmark + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Load .env file + uses: xom9ikk/dotenv@v2.3.0 + with: + load-mode: strict + + - name: Docker compose + uses: hoverkraft-tech/compose-action@v1.5.1 + with: + services: mysqldb + + - name: Run Benchmark + run: ./benchmark/scripts/run_single_benchmark.sh mysql writes + + - name: Upload Results + uses: actions/upload-artifact@v4 + if: success() + with: + name: mysql-writes-results + path: benchmark/BenchmarkDotNet.Artifacts/mysql/writes + + benchmark-postgresql-reads: + name: PostgreSQL Reads Benchmark + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Load .env file + uses: xom9ikk/dotenv@v2.3.0 + with: + load-mode: strict + + - name: Docker compose + uses: hoverkraft-tech/compose-action@v1.5.1 + with: + services: postgresdb + + - name: Run Benchmark + run: ./benchmark/scripts/run_single_benchmark.sh postgresql reads + + - name: Upload Results + uses: actions/upload-artifact@v4 + if: success() + with: + name: postgresql-reads-results + path: benchmark/BenchmarkDotNet.Artifacts/postgresql/reads + + benchmark-postgresql-writes: + name: PostgreSQL Writes Benchmark + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Load .env file + uses: xom9ikk/dotenv@v2.3.0 + with: + load-mode: strict + + - name: Docker compose + uses: hoverkraft-tech/compose-action@v1.5.1 + with: + services: postgresdb + + - name: Run Benchmark + run: ./benchmark/scripts/run_single_benchmark.sh postgresql writes + + - name: Upload Results + uses: actions/upload-artifact@v4 + if: success() + with: + name: postgresql-writes-results + path: benchmark/BenchmarkDotNet.Artifacts/postgresql/writes + + benchmark-sqlite-reads: + name: SQLite Reads Benchmark + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Load .env file + uses: xom9ikk/dotenv@v2.3.0 + with: + load-mode: strict + + - name: Run Benchmark + run: ./benchmark/scripts/run_single_benchmark.sh sqlite reads + + - name: Upload Results + uses: actions/upload-artifact@v4 + if: success() + with: + name: sqlite-reads-results + path: benchmark/BenchmarkDotNet.Artifacts/sqlite/reads + + benchmark-sqlite-writes: + name: SQLite Writes Benchmark + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Load .env file + uses: xom9ikk/dotenv@v2.3.0 + with: + load-mode: strict + + - name: Run Benchmark + run: ./benchmark/scripts/run_single_benchmark.sh sqlite writes + + - name: Upload Results + uses: actions/upload-artifact@v4 + if: success() + with: + name: sqlite-writes-results + path: benchmark/BenchmarkDotNet.Artifacts/sqlite/writes + + push-results: + name: Push Results + runs-on: ubuntu-latest + if: always() + needs: [ + benchmark-mysql-reads, benchmark-mysql-writes, + benchmark-postgresql-reads, benchmark-postgresql-writes, + benchmark-sqlite-reads, benchmark-sqlite-writes + ] + + steps: + - uses: actions/checkout@v4 + + - name: Download MySQL Reads Results + uses: actions/download-artifact@v4 + with: + name: mysql-reads-results + path: benchmark/BenchmarkDotNet.Artifacts/mysql/reads + + - name: Download MySQL Writes Results + uses: actions/download-artifact@v4 + with: + name: mysql-writes-results + path: benchmark/BenchmarkDotNet.Artifacts/mysql/writes + + - name: Download PostgreSQL Reads Results + uses: actions/download-artifact@v4 + with: + name: postgresql-reads-results + path: benchmark/BenchmarkDotNet.Artifacts/postgresql/reads + + - name: Download PostgreSQL Writes Results + uses: actions/download-artifact@v4 + with: + name: postgresql-writes-results + path: benchmark/BenchmarkDotNet.Artifacts/postgresql/writes + + - name: Download SQLite Reads Results + uses: actions/download-artifact@v4 + with: + name: sqlite-reads-results + path: benchmark/BenchmarkDotNet.Artifacts/sqlite/reads + + - name: Download SQLite Writes Results + uses: actions/download-artifact@v4 + with: + name: sqlite-writes-results + path: benchmark/BenchmarkDotNet.Artifacts/sqlite/writes + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + base: main + title: update benchmark results + commit-message: update benchmark results + branch: update-benchmark-results + branch-suffix: timestamp + delete-branch: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fed4c605..cd5f2927 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -83,6 +83,7 @@ jobs: exclude: | GeneratedProtobuf examples + benchmark/*SqlcImpl codegen-tests: name: Codegen Tests diff --git a/.gitignore b/.gitignore index e7da3328..84a44144 100644 --- a/.gitignore +++ b/.gitignore @@ -137,4 +137,6 @@ dist output/* docker-upload/* -plugin.wasm \ No newline at end of file +plugin.wasm +*.db +.env.bak \ No newline at end of file diff --git a/CodeGenerator/Generators/QueriesGen.cs b/CodeGenerator/Generators/QueriesGen.cs index 68464168..65893286 100644 --- a/CodeGenerator/Generators/QueriesGen.cs +++ b/CodeGenerator/Generators/QueriesGen.cs @@ -64,12 +64,16 @@ private ClassDeclarationSyntax GetClassDeclaration(string className, IEnumerable var dapperStatements = dbDriver.Options.UseDapper ? $$""" Utils.ConfigureSqlMapper(); - Dapper.DefaultTypeMap.MatchNamesWithUnderscores = true; + DefaultTypeMap.MatchNamesWithUnderscores = true; """ : string.Empty; + + var baseTypes = dbDriver.GetClassBaseTypes(); + var baseTypesStr = baseTypes.Length > 0 ? $" : {string.Join(", ", baseTypes)}" : string.Empty; + var classDeclaration = (ClassDeclarationSyntax)ParseMemberDeclaration( $$""" - public class {{className}} + public class {{className}}{{baseTypesStr}} { public {{className}}() { @@ -94,8 +98,12 @@ public class {{className}} private {{dbDriver.AddNullableSuffixIfNeeded(dbDriver.TransactionClassName, false)}} {{Variable.Transaction.AsPropertyName()}} { get; } private {{dbDriver.AddNullableSuffixIfNeeded("string", false)}} {{Variable.ConnectionString.AsPropertyName()}} { get; } } - """)!; - return classDeclaration.AddMembers(classMembers.ToArray()); + """)!; + + return classDeclaration.AddMembers( + [.. dbDriver.GetAdditionalClassMembers() + .AddRangeExcludeNulls(classMembers)] + ); } private IEnumerable GetMembersForSingleQuery(Query query) diff --git a/Drivers/ColumnMapping.cs b/Drivers/ColumnMapping.cs index df38edda..9f9e4b94 100644 --- a/Drivers/ColumnMapping.cs +++ b/Drivers/ColumnMapping.cs @@ -2,7 +2,7 @@ namespace SqlcGenCsharp.Drivers; -public record DbTypeInfo(int? Length = null, string? NpgsqlTypeOverride = null); +public record DbTypeInfo(int? Length = null, string? DbTypeOverride = null); public delegate string ReaderFn(int ordinal, string dbType); diff --git a/Drivers/DbDriver.cs b/Drivers/DbDriver.cs index a224cc60..c55e2b7d 100644 --- a/Drivers/DbDriver.cs +++ b/Drivers/DbDriver.cs @@ -7,7 +7,32 @@ namespace SqlcGenCsharp.Drivers; -public record ConnectionGenCommands(string EstablishConnection, string ConnectionOpen); +public class GenCommand(string commandText, bool wrapInUsing) +{ + public string WrapBlock(string blockText) + { + return wrapInUsing + ? $$""" + using ({{commandText}}) + { + {{blockText}} + } + """ + : $$""" + {{commandText}}; + {{blockText}} + """; + } +} + +public record ConnectionGenCommands( + GenCommand GetConnectionOrDataSource, + string ConnectionOpen = ""); + +public record CommandGenCommands( + GenCommand CommandCreation, + string SetCommandText, + string PrepareCommand); public abstract class DbDriver { @@ -69,7 +94,7 @@ public static string TransformQueryForSliceArgs(string originalSql, int sliceSiz """; public readonly string TransactionConnectionNullExcetionThrow = $""" - if (this.{Variable.Transaction.AsPropertyName()}?.Connection == null || this.{Variable.Transaction.AsPropertyName()}?.Connection.State != System.Data.ConnectionState.Open) + if (this.{Variable.Transaction.AsPropertyName()}?.Connection == null || this.{Variable.Transaction.AsPropertyName()}?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); """; @@ -148,6 +173,8 @@ public virtual ISet GetUsingDirectivesForQueries() { "System", "System.Collections.Generic", + "System.Data", + "System.Threading", "System.Threading.Tasks" } .AddRangeIf([ @@ -191,7 +218,7 @@ public virtual ISet GetUsingDirectivesForModels() .AddRangeExcludeNulls(GetUsingDirectivesForColumnMappings()); } - public string[] GetConstructorStatements() + public virtual string[] GetConstructorStatements() { return [$"this.{Variable.ConnectionString.AsPropertyName()} = {Variable.ConnectionString.AsVarName()};"]; } @@ -201,6 +228,16 @@ public string[] GetTransactionConstructorStatements() return [$"this.{Variable.Transaction.AsPropertyName()} = {Variable.Transaction.AsVarName()};"]; } + public virtual string[] GetClassBaseTypes() + { + return []; + } + + public virtual MemberDeclarationSyntax[] GetAdditionalClassMembers() + { + return []; + } + protected virtual ISet GetConfigureSqlMappings() { return ColumnMappings @@ -220,7 +257,8 @@ public static void ConfigureSqlMapper() { {{GetConfigureSqlMappings().JoinByNewLine()}} } - """)!]; + """)! + ]; } private MemberDeclarationSyntax[] GetSqlMapperMemberDeclarations() @@ -234,7 +272,7 @@ private MemberDeclarationSyntax[] GetSqlMapperMemberDeclarations() public abstract ConnectionGenCommands EstablishConnection(Query query); - public abstract string CreateSqlCommand(string sqlTextConstant); + public abstract CommandGenCommands CreateSqlCommand(string sqlTextConstant); /* Since there is no indication of the primary key column in SQLC protobuf (assuming it is a single column), this method uses a few heuristics to assess the data type of the id column @@ -387,6 +425,19 @@ private static bool DoesColumnMappingApply(ColumnMapping columnMapping, Column c return typeInfo.Length.Value == column.Length; } + public string? GetColumnDbTypeOverride(Column column) + { + if (column.IsArray) + return null; // TODO: handle array columns + var columnType = column.Type.Name.ToLower(); + foreach (var columnMapping in ColumnMappings.Values) + { + if (columnMapping.DbTypes.TryGetValue(columnType, out var dbTypeOverride)) + return dbTypeOverride.DbTypeOverride; + } + return null; + } + public virtual WriterFn? GetWriterFn(Column column, Query query) { var csharpType = GetCsharpTypeWithoutNullableSuffix(column, query); diff --git a/Drivers/Generators/CommonGen.cs b/Drivers/Generators/CommonGen.cs index f330b24e..7dcd9e59 100644 --- a/Drivers/Generators/CommonGen.cs +++ b/Drivers/Generators/CommonGen.cs @@ -13,6 +13,11 @@ public static string GetMethodParameterList(string argInterface, IEnumerable({{sqlVar}}{{dapperArgs}}); - """; + var connectionCommands = dbDriver.EstablishConnection(query); + var dapperArgs = CommonGen.GetDapperArgs(query); + var idColumnType = dbDriver.GetIdColumnType(query); + return connectionCommands.GetConnectionOrDataSource.WrapBlock($""" + return await {Variable.Connection.AsVarName()}.QuerySingleAsync<{idColumnType}>({sqlVar}{dapperArgs}); + """); } private string GetDapperWithTxBody(string sqlVar, Query query) @@ -58,46 +58,46 @@ private string GetDapperWithTxBody(string sqlVar, Query query) var transactionProperty = Variable.Transaction.AsPropertyName(); var dapperArgs = query.Params.Any() ? $", {Variable.QueryParams.AsVarName()}" : string.Empty; return $$""" - {{dbDriver.TransactionConnectionNullExcetionThrow}} - return await this.{{transactionProperty}}.Connection.QuerySingleAsync<{{dbDriver.GetIdColumnType(query)}}>({{sqlVar}}{{dapperArgs}}, transaction: this.{{transactionProperty}}); - """; + {{dbDriver.TransactionConnectionNullExcetionThrow}} + return await this.{{transactionProperty}}.Connection.QuerySingleAsync<{{dbDriver.GetIdColumnType(query)}}>({{sqlVar}}{{dapperArgs}}, transaction: this.{{transactionProperty}}); + """; } private string GetDriverNoTxBody(string sqlVar, Query query) { - var (establishConnection, connectionOpen) = dbDriver.EstablishConnection(query); - var createSqlCommand = dbDriver.CreateSqlCommand(sqlVar); - var commandParameters = dbDriver.AddParametersToCommand(query); + var connectionCommands = dbDriver.EstablishConnection(query); + var sqlCommands = dbDriver.CreateSqlCommand(sqlVar); var returnLastId = ((IExecLastId)dbDriver).GetLastIdStatement(query).JoinByNewLine(); - return $$""" - using ({{establishConnection}}) - { - {{connectionOpen.AppendSemicolonUnlessEmpty()}} - using ({{createSqlCommand}}) - { - {{commandParameters}} - {{returnLastId}} - } - } - """; + var commandBlock = sqlCommands.CommandCreation.WrapBlock( + $$""" + {{sqlCommands.SetCommandText.AppendSemicolonUnlessEmpty()}} + {{dbDriver.AddParametersToCommand(query)}} + {{sqlCommands.PrepareCommand.AppendSemicolonUnlessEmpty()}} + {{returnLastId}} + """ + ); + return connectionCommands.GetConnectionOrDataSource.WrapBlock( + $$""" + {{connectionCommands.ConnectionOpen.AppendSemicolonUnlessEmpty()}} + {{commandBlock}} + """ + ); } private string GetDriverWithTxBody(string sqlVar, Query query) { var transactionProperty = Variable.Transaction.AsPropertyName(); var commandVar = Variable.Command.AsVarName(); - var commandParameters = dbDriver.AddParametersToCommand(query); - var returnLastId = ((IExecLastId)dbDriver).GetLastIdStatement(query).JoinByNewLine(); return $$""" - {{dbDriver.TransactionConnectionNullExcetionThrow}} - using (var {{commandVar}} = this.{{transactionProperty}}.Connection.CreateCommand()) - { - {{commandVar}}.CommandText = {{sqlVar}}; - {{commandVar}}.Transaction = this.{{transactionProperty}}; - {{commandParameters}} - {{returnLastId}} - } - """; + {{dbDriver.TransactionConnectionNullExcetionThrow}} + using (var {{commandVar}} = this.{{transactionProperty}}.Connection.CreateCommand()) + { + {{commandVar}}.CommandText = {{sqlVar}}; + {{commandVar}}.Transaction = this.{{transactionProperty}}; + {{dbDriver.AddParametersToCommand(query)}} + {{((IExecLastId)dbDriver).GetLastIdStatement(query).JoinByNewLine()}} + } + """; } } \ No newline at end of file diff --git a/Drivers/Generators/ExecRowsDeclareGen.cs b/Drivers/Generators/ExecRowsDeclareGen.cs index 7eb7c4bc..701c68d4 100644 --- a/Drivers/Generators/ExecRowsDeclareGen.cs +++ b/Drivers/Generators/ExecRowsDeclareGen.cs @@ -1,6 +1,5 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Plugin; -using System.Linq; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; namespace SqlcGenCsharp.Drivers.Generators; @@ -45,59 +44,59 @@ private string GetMethodBody(string queryTextConstant, Query query) private string GetDapperNoTxBody(string sqlVar, Query query) { - var (establishConnection, _) = dbDriver.EstablishConnection(query); - var dapperArgs = query.Params.Any() ? $", {Variable.QueryParams.AsVarName()}" : string.Empty; - return $$""" - using ({{establishConnection}}) - return await {{Variable.Connection.AsVarName()}}.ExecuteAsync({{sqlVar}}{{dapperArgs}}); - """; + var connectionCommands = dbDriver.EstablishConnection(query); + var dapperArgs = CommonGen.GetDapperArgs(query); + return connectionCommands.GetConnectionOrDataSource.WrapBlock( + $"return await {Variable.Connection.AsVarName()}.ExecuteAsync({sqlVar}{dapperArgs});" + ); } private string GetDapperWithTxBody(string sqlVar, Query query) { var transactionProperty = Variable.Transaction.AsPropertyName(); - var dapperArgs = query.Params.Any() ? $", {Variable.QueryParams.AsVarName()}" : string.Empty; + var dapperArgs = CommonGen.GetDapperArgs(query); return $$""" - {{dbDriver.TransactionConnectionNullExcetionThrow}} - return await this.{{transactionProperty}}.Connection.ExecuteAsync( - {{sqlVar}}{{dapperArgs}}, - transaction: this.{{transactionProperty}}); - """; + {{dbDriver.TransactionConnectionNullExcetionThrow}} + return await this.{{transactionProperty}}.Connection.ExecuteAsync( + {{sqlVar}}{{dapperArgs}}, + transaction: this.{{transactionProperty}}); + """; } private string GetDriverNoTxBody(string sqlVar, Query query) { - var (establishConnection, connectionOpen) = dbDriver.EstablishConnection(query); - var createSqlCommand = dbDriver.CreateSqlCommand(sqlVar); - var commandParameters = dbDriver.AddParametersToCommand(query); - return $$""" - using ({{establishConnection}}) - { - {{connectionOpen.AppendSemicolonUnlessEmpty()}} - using ({{createSqlCommand}}) - { - {{commandParameters}} - return await {{Variable.Command.AsVarName()}}.ExecuteNonQueryAsync(); - } - } - """; + var connectionCommands = dbDriver.EstablishConnection(query); + var sqlCommands = dbDriver.CreateSqlCommand(sqlVar); + var commandBlock = sqlCommands.CommandCreation.WrapBlock( + $""" + {sqlCommands.SetCommandText.AppendSemicolonUnlessEmpty()} + {dbDriver.AddParametersToCommand(query)} + {sqlCommands.PrepareCommand.AppendSemicolonUnlessEmpty()} + return await {Variable.Command.AsVarName()}.ExecuteNonQueryAsync(); + """ + ); + return connectionCommands.GetConnectionOrDataSource.WrapBlock( + $$""" + {{connectionCommands.ConnectionOpen.AppendSemicolonUnlessEmpty()}} + {{commandBlock}} + """ + ); } private string GetDriverWithTxBody(string sqlVar, Query query) { var transactionProperty = Variable.Transaction.AsPropertyName(); var commandVar = Variable.Command.AsVarName(); - var commandParameters = dbDriver.AddParametersToCommand(query); return $$""" - {{dbDriver.TransactionConnectionNullExcetionThrow}} - using (var {{commandVar}} = this.{{transactionProperty}}.Connection.CreateCommand()) - { - {{commandVar}}.CommandText = {{sqlVar}}; - {{commandVar}}.Transaction = this.{{transactionProperty}}; - {{commandParameters}} - return await {{commandVar}}.ExecuteNonQueryAsync(); - } - """; + {{dbDriver.TransactionConnectionNullExcetionThrow}} + using (var {{commandVar}} = this.{{transactionProperty}}.Connection.CreateCommand()) + { + {{commandVar}}.CommandText = {{sqlVar}}; + {{commandVar}}.Transaction = this.{{transactionProperty}}; + {{dbDriver.AddParametersToCommand(query)}} + return await {{commandVar}}.ExecuteNonQueryAsync(); + } + """; } } \ No newline at end of file diff --git a/Drivers/Generators/ManyDeclareGen.cs b/Drivers/Generators/ManyDeclareGen.cs index 954a8839..4371b455 100644 --- a/Drivers/Generators/ManyDeclareGen.cs +++ b/Drivers/Generators/ManyDeclareGen.cs @@ -36,105 +36,96 @@ private string GetMethodBody(string queryTextConstant, string returnInterface, Q var withTxBody = useDapper ? GetDapperWithTxBody(sqlVar, returnInterface, query) : GetDriverWithTxBody(sqlVar, returnInterface, query); return $$""" - {{sqlTextTransform}} - {{dapperParams}} - if (this.{{transactionProperty}} == null) - { - {{noTxBody}} - } - {{withTxBody}} - """; + {{sqlTextTransform}} + {{dapperParams}} + if (this.{{transactionProperty}} == null) + { + {{noTxBody}} + } + {{withTxBody}} + """; } private string GetDapperNoTxBody(string sqlVar, string returnInterface, Query query) { - var (establishConnection, _) = dbDriver.EstablishConnection(query); - var dapperArgs = query.Params.Any() ? $", {Variable.QueryParams.AsVarName()}" : string.Empty; + var connectionCommands = dbDriver.EstablishConnection(query); + var dapperArgs = CommonGen.GetDapperArgs(query); var returnType = dbDriver.AddNullableSuffixIfNeeded(returnInterface, true); - - return $$""" - using ({{establishConnection}}) - { - var {{Variable.Result.AsVarName()}} = await {{Variable.Connection.AsVarName()}}.QueryAsync<{{returnType}}>({{sqlVar}}{{dapperArgs}}); - return {{Variable.Result.AsVarName()}}.AsList(); - } - """; + var resultVar = Variable.Result.AsVarName(); + return connectionCommands.GetConnectionOrDataSource.WrapBlock( + $""" + var {resultVar} = await {Variable.Connection.AsVarName()}.QueryAsync<{returnType}>({sqlVar}{dapperArgs}); + return {resultVar}.AsList(); + """ + ); } private string GetDapperWithTxBody(string sqlVar, string returnInterface, Query query) { var transactionProperty = Variable.Transaction.AsPropertyName(); - var dapperArgs = query.Params.Any() ? $", {Variable.QueryParams.AsVarName()}" : string.Empty; + var dapperArgs = CommonGen.GetDapperArgs(query); var returnType = dbDriver.AddNullableSuffixIfNeeded(returnInterface, true); return $$""" - {{dbDriver.TransactionConnectionNullExcetionThrow}} - return (await this.{{transactionProperty}}.Connection.QueryAsync<{{returnType}}>( - {{sqlVar}}{{dapperArgs}}, - transaction: this.{{transactionProperty}})).AsList(); - """; + {{dbDriver.TransactionConnectionNullExcetionThrow}} + return (await this.{{transactionProperty}}.Connection.QueryAsync<{{returnType}}>( + {{sqlVar}}{{dapperArgs}}, + transaction: this.{{transactionProperty}})).AsList(); + """; } private string GetDriverNoTxBody(string sqlVar, string returnInterface, Query query) { - var (establishConnection, connectionOpen) = dbDriver.EstablishConnection(query); - var createSqlCommand = dbDriver.CreateSqlCommand(sqlVar); - var commandParameters = dbDriver.AddParametersToCommand(query); - var initDataReader = CommonGen.InitDataReader(); - var awaitReaderRow = CommonGen.AwaitReaderRow(); - var dataclassInit = CommonGen.InstantiateDataclass(query.Columns.ToArray(), returnInterface, query); + var connectionCommands = dbDriver.EstablishConnection(query); + var dataclassInit = CommonGen.InstantiateDataclass([.. query.Columns], returnInterface, query); var resultVar = Variable.Result.AsVarName(); var readWhileExists = $$""" - while ({{awaitReaderRow}}) - {{resultVar}}.Add({{dataclassInit}}); - """; - // TODO: add return null at end of code run so transaction code will not run? - return $$""" - using ({{establishConnection}}) - { - {{connectionOpen.AppendSemicolonUnlessEmpty()}} - using ({{createSqlCommand}}) - { - {{commandParameters}} - using ({{initDataReader}}) - { - var {{resultVar}} = new List<{{returnInterface}}>(); - {{readWhileExists}} - return {{resultVar}}; - } - } - } - """; + while ({{CommonGen.AwaitReaderRow()}}) + {{resultVar}}.Add({{dataclassInit}}); + """; + var sqlCommands = dbDriver.CreateSqlCommand(sqlVar); + var commandBlock = sqlCommands.CommandCreation.WrapBlock( + $$""" + {{sqlCommands.SetCommandText.AppendSemicolonUnlessEmpty()}} + {{dbDriver.AddParametersToCommand(query)}} + {{sqlCommands.PrepareCommand.AppendSemicolonUnlessEmpty()}} + using ({{CommonGen.InitDataReader()}}) + { + var {{resultVar}} = new List<{{returnInterface}}>(); + {{readWhileExists}} + return {{resultVar}}; + } + """ + ); + return connectionCommands.GetConnectionOrDataSource.WrapBlock( + $$""" + {{connectionCommands.ConnectionOpen.AppendSemicolonUnlessEmpty()}} + {{commandBlock}} + """ + ); } private string GetDriverWithTxBody(string sqlVar, string returnInterface, Query query) { var transactionProperty = Variable.Transaction.AsPropertyName(); var commandVar = Variable.Command.AsVarName(); - var commandParameters = dbDriver.AddParametersToCommand(query); - var initDataReader = CommonGen.InitDataReader(); - var awaitReaderRow = CommonGen.AwaitReaderRow(); - var dataclassInit = CommonGen.InstantiateDataclass(query.Columns.ToArray(), returnInterface, query); var resultVar = Variable.Result.AsVarName(); - var readWhileExists = $$""" - while ({{awaitReaderRow}}) - {{resultVar}}.Add({{dataclassInit}}); - """; return $$""" - {{dbDriver.TransactionConnectionNullExcetionThrow}} - using (var {{commandVar}} = this.{{transactionProperty}}.Connection.CreateCommand()) - { - {{commandVar}}.CommandText = {{sqlVar}}; - {{commandVar}}.Transaction = this.{{transactionProperty}}; - {{commandParameters}} - using ({{initDataReader}}) - { - var {{resultVar}} = new List<{{returnInterface}}>(); - {{readWhileExists}} - return {{resultVar}}; - } - } - """; + {{dbDriver.TransactionConnectionNullExcetionThrow}} + using (var {{commandVar}} = this.{{transactionProperty}}.Connection.CreateCommand()) + { + {{commandVar}}.CommandText = {{sqlVar}}; + {{commandVar}}.Transaction = this.{{transactionProperty}}; + {{dbDriver.AddParametersToCommand(query)}} + using ({{CommonGen.InitDataReader()}}) + { + var {{resultVar}} = new List<{{returnInterface}}>(); + while ({{CommonGen.AwaitReaderRow()}}) + {{resultVar}}.Add({{CommonGen.InstantiateDataclass([.. query.Columns], returnInterface, query)}}); + return {{resultVar}}; + } + } + """; } } \ No newline at end of file diff --git a/Drivers/Generators/OneDeclareGen.cs b/Drivers/Generators/OneDeclareGen.cs index 20734b77..47c25b15 100644 --- a/Drivers/Generators/OneDeclareGen.cs +++ b/Drivers/Generators/OneDeclareGen.cs @@ -36,99 +36,95 @@ private string GetMethodBody(string queryTextConstant, string returnInterface, Q var withTxBody = useDapper ? GetDapperWithTxBody(sqlVar, returnInterface, query) : GetDriverWithTxBody(sqlVar, returnInterface, query); return $$""" - {{sqlTextTransform}} - {{dapperParams}} - if (this.{{transactionProperty}} == null) - { - {{noTxBody}} - } - {{withTxBody}} - """; + {{sqlTextTransform}} + {{dapperParams}} + if (this.{{transactionProperty}} == null) + { + {{noTxBody}} + } + {{withTxBody}} + """; } private string GetDapperNoTxBody(string sqlVar, string returnInterface, Query query) { - var (establishConnection, _) = dbDriver.EstablishConnection(query); - var dapperArgs = query.Params.Any() ? $", {Variable.QueryParams.AsVarName()}" : string.Empty; + var connectionCommands = dbDriver.EstablishConnection(query); + var dapperArgs = CommonGen.GetDapperArgs(query); var returnType = dbDriver.AddNullableSuffixIfNeeded(returnInterface, false); - - return $$""" - using ({{establishConnection}}) - { - var {{Variable.Result.AsVarName()}} = await {{Variable.Connection.AsVarName()}}.QueryFirstOrDefaultAsync<{{returnType}}>({{sqlVar}}{{dapperArgs}}); - return {{Variable.Result.AsVarName()}}; - } - """; + var connectionVar = Variable.Connection.AsVarName(); + var resultVar = Variable.Result.AsVarName(); + return connectionCommands.GetConnectionOrDataSource.WrapBlock($$""" + var {{resultVar}} = await {{connectionVar}}.QueryFirstOrDefaultAsync<{{returnType}}>({{sqlVar}}{{dapperArgs}}); + return {{resultVar}}; + """); } private string GetDapperWithTxBody(string sqlVar, string returnInterface, Query query) { var transactionProperty = Variable.Transaction.AsPropertyName(); - var dapperArgs = query.Params.Any() ? $", {Variable.QueryParams.AsVarName()}" : string.Empty; + var dapperArgs = CommonGen.GetDapperArgs(query); var returnType = dbDriver.AddNullableSuffixIfNeeded(returnInterface, false); return $$""" - {{dbDriver.TransactionConnectionNullExcetionThrow}} - return await this.{{transactionProperty}}.Connection.QueryFirstOrDefaultAsync<{{returnType}}>( - {{sqlVar}}{{dapperArgs}}, - transaction: this.{{transactionProperty}}); - """; + {{dbDriver.TransactionConnectionNullExcetionThrow}} + return await this.{{transactionProperty}}.Connection.QueryFirstOrDefaultAsync<{{returnType}}>( + {{sqlVar}}{{dapperArgs}}, + transaction: this.{{transactionProperty}}); + """; } private string GetDriverNoTxBody(string sqlVar, string returnInterface, Query query) { - var (establishConnection, connectionOpen) = dbDriver.EstablishConnection(query); - var createSqlCommand = dbDriver.CreateSqlCommand(sqlVar); - var commandParameters = dbDriver.AddParametersToCommand(query); - var initDataReader = CommonGen.InitDataReader(); - var awaitReaderRow = CommonGen.AwaitReaderRow(); - var returnDataclass = CommonGen.InstantiateDataclass(query.Columns.ToArray(), returnInterface, query); - - return $$""" - using ({{establishConnection}}) - { - {{connectionOpen.AppendSemicolonUnlessEmpty()}} - using ({{createSqlCommand}}) - { - {{commandParameters}} - using ({{initDataReader}}) - { - if ({{awaitReaderRow}}) - { - return {{returnDataclass}}; - } - } - } - } - return null; - """; + var connectionCommands = dbDriver.EstablishConnection(query); + var sqlCommands = dbDriver.CreateSqlCommand(sqlVar); + var returnDataclass = CommonGen.InstantiateDataclass([.. query.Columns], returnInterface, query); + var commandBlock = sqlCommands.CommandCreation.WrapBlock( + $$""" + {{sqlCommands.SetCommandText.AppendSemicolonUnlessEmpty()}} + {{dbDriver.AddParametersToCommand(query)}} + {{sqlCommands.PrepareCommand.AppendSemicolonUnlessEmpty()}} + using ({{CommonGen.InitDataReader()}}) + { + if ({{CommonGen.AwaitReaderRow()}}) + { + return {{returnDataclass}}; + } + } + """ + ); + var wrappedBlock = connectionCommands.GetConnectionOrDataSource.WrapBlock( + $$""" + {{connectionCommands.ConnectionOpen.AppendSemicolonUnlessEmpty()}} + {{commandBlock}} + """ + ); + return $""" + {wrappedBlock}; + return null; + """; } private string GetDriverWithTxBody(string sqlVar, string returnInterface, Query query) { var transactionProperty = Variable.Transaction.AsPropertyName(); var commandVar = Variable.Command.AsVarName(); - var commandParameters = dbDriver.AddParametersToCommand(query); - var initDataReader = CommonGen.InitDataReader(); - var awaitReaderRow = CommonGen.AwaitReaderRow(); - var returnDataclass = CommonGen.InstantiateDataclass(query.Columns.ToArray(), returnInterface, query); return $$""" - {{dbDriver.TransactionConnectionNullExcetionThrow}} - using (var {{commandVar}} = this.{{transactionProperty}}.Connection.CreateCommand()) + {{dbDriver.TransactionConnectionNullExcetionThrow}} + using (var {{commandVar}} = this.{{transactionProperty}}.Connection.CreateCommand()) + { + {{commandVar}}.CommandText = {{sqlVar}}; + {{commandVar}}.Transaction = this.{{transactionProperty}}; + {{dbDriver.AddParametersToCommand(query)}} + using ({{CommonGen.InitDataReader()}}) + { + if ({{CommonGen.AwaitReaderRow()}}) { - {{commandVar}}.CommandText = {{sqlVar}}; - {{commandVar}}.Transaction = this.{{transactionProperty}}; - {{commandParameters}} - using ({{initDataReader}}) - { - if ({{awaitReaderRow}}) - { - return {{returnDataclass}}; - } - } + return {{CommonGen.InstantiateDataclass([.. query.Columns], returnInterface, query)}}; } - return null; - """; + } + } + return null; + """; } } \ No newline at end of file diff --git a/Drivers/MySqlConnectorDriver.cs b/Drivers/MySqlConnectorDriver.cs index 301259f2..1a4115a0 100644 --- a/Drivers/MySqlConnectorDriver.cs +++ b/Drivers/MySqlConnectorDriver.cs @@ -1,7 +1,6 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Plugin; using SqlcGenCsharp.Drivers.Generators; -using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; @@ -48,7 +47,7 @@ public sealed partial class MySqlConnectorDriver( { "mediumint", new() } }, readerFn: (ordinal, _) => $"{Variable.Reader.AsVarName()}.GetInt32({ordinal})", - convertFunc: x => $"Convert.ToInt32{x}" + convertFunc: x => $"Convert.ToInt32({x})" ), ["long"] = new( new() @@ -56,7 +55,7 @@ public sealed partial class MySqlConnectorDriver( { "bigint", new() } }, readerFn: (ordinal, _) => $"{Variable.Reader.AsVarName()}.GetInt64({ordinal})", - convertFunc: x => $"Convert.ToInt64{x}" + convertFunc: x => $"Convert.ToInt64({x})" ), ["double"] = new( new() @@ -130,7 +129,7 @@ public sealed partial class MySqlConnectorDriver( ["Instant"] = new( [], readerFn: (ordinal, _) => $$""" - (new Func((r, o) => + (new Func((r, o) => { var dt = {{Variable.Reader.AsVarName()}}.GetDateTime(o); if (dt.Kind != DateTimeKind.Utc) @@ -145,7 +144,7 @@ public sealed partial class MySqlConnectorDriver( var nullValue = isDapper ? "null" : "(object)DBNull.Value"; return $"{el} is null ? {nullValue} : (DateTime?) DateTime.SpecifyKind({el}.Value.ToDateTimeUtc(), DateTimeKind.Unspecified)"; }, - usingDirectives: ["System", "NodaTime", "NodaTime.Extensions"], + usingDirectives: ["System", "NodaTime", "NodaTime.Extensions", "System.Data.Common"], sqlMapper: "SqlMapper.AddTypeHandler(typeof(Instant), new NodaInstantTypeHandler());", sqlMapperImpl: DateTimeNodaInstantTypeHandler ), @@ -474,14 +473,82 @@ public class {{x}}CsvConverter : DefaultTypeConverter public override ConnectionGenCommands EstablishConnection(Query query) { return new( - $"var {Variable.Connection.AsVarName()} = new MySqlConnection({Variable.ConnectionString.AsPropertyName()})", - $"await {Variable.Connection.AsVarName()}.OpenAsync()" + GetConnectionOrDataSource: new( + $"var {Variable.Connection.AsVarName()} = await GetDataSource().OpenConnectionAsync()", + true) + // ConnectionOpen: string.Empty ); } - public override string CreateSqlCommand(string sqlTextConstant) + public override string[] GetClassBaseTypes() { - return $"var {Variable.Command.AsVarName()} = new MySqlCommand({sqlTextConstant}, {Variable.Connection.AsVarName()})"; + return ["IDisposable"]; + } + + public override string[] GetConstructorStatements() + { + var baseStatements = base.GetConstructorStatements(); + var dataSourceVar = Variable.DataSource.AsFieldName(); + var connectionStringVar = Variable.ConnectionString.AsVarName(); + var optionalNotNullVerify = Options.DotnetFramework.IsDotnetCore() ? "!" : string.Empty; + + return + [ + .. baseStatements, + $$""" + {{dataSourceVar}} = new Lazy(() => + { + var builder = new MySqlConnectionStringBuilder({{connectionStringVar}}{{optionalNotNullVerify}}); + builder.ConnectionReset = true; + // Pre-warm connection pool with minimum connections + if (builder.MinimumPoolSize == 0) + builder.MinimumPoolSize = 1; + return new MySqlDataSourceBuilder(builder.ConnectionString).Build(); + }, LazyThreadSafetyMode.ExecutionAndPublication); + """, + ]; + } + + public override MemberDeclarationSyntax[] GetAdditionalClassMembers() + { + var dataSourceField = Variable.DataSource.AsFieldName(); + var optionalNotNullVerify = Options.DotnetFramework.IsDotnetCore() ? "?" : string.Empty; + + return [ + ParseMemberDeclaration($$""" + private readonly Lazy{{optionalNotNullVerify}} {{dataSourceField}}; + """)!, + ParseMemberDeclaration($$""" + private MySqlDataSource GetDataSource() + { + if ({{dataSourceField}} == null) + throw new InvalidOperationException("ConnectionString is required when not using a transaction"); + return {{dataSourceField}}.Value; + } + """)!, + ParseMemberDeclaration($$""" + public void Dispose() + { + GC.SuppressFinalize(this); + if ({{dataSourceField}}?.IsValueCreated == true) + {{dataSourceField}}.Value.Dispose(); + } + """)! + ]; + } + + public override CommandGenCommands CreateSqlCommand(string sqlTextConstant) + { + var commandVar = Variable.Command.AsVarName(); + var connectionVar = Variable.Connection.AsVarName(); + + return new CommandGenCommands( + CommandCreation: new( + $"var {commandVar} = {connectionVar}.CreateCommand()", + true), + SetCommandText: $"{commandVar}.CommandText = {sqlTextConstant}", + PrepareCommand: string.Empty + ); } public override string TransformQueryText(Query query) @@ -492,7 +559,7 @@ public override string TransformQueryText(Query query) var counter = 0; var queryText = query.Text; queryText = QueryParamRegex().Replace(queryText, _ => "@" + query.Params[counter++].Column.Name); - queryText = Options.UseDapper && query.Cmd == ":execlastid" + queryText = query.Cmd == ":execlastid" ? $"{queryText}; SELECT LAST_INSERT_ID()" : queryText; @@ -502,15 +569,6 @@ public override string TransformQueryText(Query query) [GeneratedRegex(@"\?")] private static partial Regex QueryParamRegex(); - public override string[] GetLastIdStatement(Query query) - { - return - [ - $"await {Variable.Command.AsVarName()}.ExecuteNonQueryAsync();", - $"return {Variable.Command.AsVarName()}.LastInsertedId;" - ]; - } - /* :copyfrom methods */ public const string NullToStringCsvConverter = "NullToStringCsvConverter"; private const string BoolToBitCsvConverter = "BoolToBitCsvConverter"; @@ -525,11 +583,31 @@ public string GetCopyFromImpl(Query query, string queryTextConstant) var csvWriterVar = Variable.CsvWriter.AsVarName(); var loaderVar = Variable.Loader.AsVarName(); var optionsVar = Variable.Options.AsVarName(); + var dataSourceVar = Variable.DataSource.AsVarName(); var connectionVar = Variable.Connection.AsVarName(); var nullConverterFn = Variable.NullConverterFn.AsVarName(); var loaderColumns = query.Params.Select(p => $"\"{p.Column.Name}\"").JoinByComma(); - var (establishConnection, connectionOpen) = EstablishConnection(query); + var connectionCommands = EstablishConnection(query); + var qualifiedTableName = !string.IsNullOrEmpty(query.InsertIntoTable.Schema) + ? $"{query.InsertIntoTable.Schema}.{query.InsertIntoTable.Name}" + : query.InsertIntoTable.Name; + + var commandBlock = $$""" + var {{loaderVar}} = new MySqlBulkLoader({{connectionVar}}) + { + Local = true, + TableName = "{{qualifiedTableName}}", + FileName = "{{tempCsvFilename}}", + FieldTerminator = "{{csvDelimiter}}", + FieldQuotationCharacter = '"', + FieldQuotationOptional = true, + NumberOfLinesToSkip = 1, + LineTerminator = "\n" + }; + {{loaderVar}}.Columns.AddRange(new List { {{loaderColumns}} }); + await {{loaderVar}}.LoadAsync(); + """; return $$""" const string supportedDateTimeFormat = "yyyy-MM-dd H:mm:ss"; @@ -548,25 +626,12 @@ public string GetCopyFromImpl(Query query, string queryTextConstant) {{GetCsvConverters(query).JoinByNewLine()}} await {{csvWriterVar}}.WriteRecordsAsync({{Variable.Args.AsVarName()}}); } - - using ({{establishConnection}}) - { - {{connectionOpen.AppendSemicolonUnlessEmpty()}} - var {{loaderVar}} = new MySqlBulkLoader({{connectionVar}}) - { - Local = true, - TableName = "{{query.InsertIntoTable.Name}}", - FileName = "{{tempCsvFilename}}", - FieldTerminator = "{{csvDelimiter}}", - FieldQuotationCharacter = '"', - FieldQuotationOptional = true, - NumberOfLinesToSkip = 1, - LineTerminator = "\n" - }; - {{loaderVar}}.Columns.AddRange(new List { {{loaderColumns}} }); - await {{loaderVar}}.LoadAsync(); - await {{connectionVar}}.CloseAsync(); - } + {{connectionCommands.GetConnectionOrDataSource.WrapBlock( + $$""" + {{connectionCommands.ConnectionOpen.AppendSemicolonUnlessEmpty()}} + {{commandBlock}} + """ + )}} """; } diff --git a/Drivers/NpgsqlDriver.cs b/Drivers/NpgsqlDriver.cs index 49eee10e..323185fc 100644 --- a/Drivers/NpgsqlDriver.cs +++ b/Drivers/NpgsqlDriver.cs @@ -88,7 +88,7 @@ public NpgsqlDriver( { { "numeric", new() }, { "decimal", new() }, - { "money", new(NpgsqlTypeOverride: "NpgsqlDbType.Money") } + { "money", new(DbTypeOverride: "NpgsqlDbType.Money") } }, readerFn: (ordinal, _) => $"{Variable.Reader.AsVarName()}.GetDecimal({ordinal})", readerArrayFn: (ordinal, _) => $"{Variable.Reader.AsVarName()}.GetFieldValue({ordinal})" @@ -123,8 +123,8 @@ public NpgsqlDriver( ["TimeSpan"] = new( new() { - { "time", new(NpgsqlTypeOverride: "NpgsqlDbType.Time") }, - { "interval", new(NpgsqlTypeOverride: "NpgsqlDbType.Interval") } + { "time", new(DbTypeOverride: "NpgsqlDbType.Time") }, + { "interval", new(DbTypeOverride: "NpgsqlDbType.Interval") } }, readerFn: (ordinal, _) => $"{Variable.Reader.AsVarName()}.GetFieldValue({ordinal})", readerArrayFn: (ordinal, _) => $"{Variable.Reader.AsVarName()}.GetFieldValue({ordinal})" @@ -132,12 +132,13 @@ public NpgsqlDriver( ["DateTime"] = new( new() { - { "date", new(NpgsqlTypeOverride: "NpgsqlDbType.Date") }, - { "timestamp", new(NpgsqlTypeOverride: "NpgsqlDbType.Timestamp") }, - { "timestamptz", new(NpgsqlTypeOverride: "NpgsqlDbType.TimestampTz") } + { "date", new(DbTypeOverride: "NpgsqlDbType.Date") }, + { "timestamp", new(DbTypeOverride: "NpgsqlDbType.Timestamp") }, + { "timestamptz", new(DbTypeOverride: "NpgsqlDbType.TimestampTz") } }, readerFn: (ordinal, _) => $"{Variable.Reader.AsVarName()}.GetDateTime({ordinal})", - readerArrayFn: (ordinal, _) => $"{Variable.Reader.AsVarName()}.GetFieldValue({ordinal})" + readerArrayFn: (ordinal, _) => $"{Variable.Reader.AsVarName()}.GetFieldValue({ordinal})", + usingDirectives: ["NpgsqlTypes"] ), ["Instant"] = new( [], @@ -166,8 +167,8 @@ public NpgsqlDriver( ["JsonElement"] = new( new() { - { "json", new(NpgsqlTypeOverride: "NpgsqlDbType.Json") }, - { "jsonb", new(NpgsqlTypeOverride: "NpgsqlDbType.Jsonb") } + { "json", new(DbTypeOverride: "NpgsqlDbType.Json") }, + { "jsonb", new(DbTypeOverride: "NpgsqlDbType.Jsonb") } }, readerFn: (ordinal, _) => $"JsonSerializer.Deserialize(reader.GetString({ordinal}))", writerFn: (el, _, notNull, isDapper, isLegacy) => @@ -184,7 +185,7 @@ public NpgsqlDriver( ["XmlDocument"] = new( new() { - { "xml", new(NpgsqlTypeOverride: "NpgsqlDbType.Xml") } + { "xml", new(DbTypeOverride: "NpgsqlDbType.Xml") } }, readerFn: (ordinal, dbType) => $$""" (new Func((r, o) => @@ -455,7 +456,6 @@ public override ISet GetUsingDirectivesForQueries() return base.GetUsingDirectivesForQueries().AddRangeExcludeNulls( [ "Npgsql", - "System.Data" ]); } @@ -538,26 +538,72 @@ public static string Stringify(this {{name}} me) public override ConnectionGenCommands EstablishConnection(Query query) { - var connectionStringVar = Variable.ConnectionString.AsPropertyName(); var connectionVar = Variable.Connection.AsVarName(); - var embedTableExists = query.Columns.Any(c => c.EmbedTable is not null); - var useOpenConnection = query.Cmd == ":copyfrom" || (Options.UseDapper && !embedTableExists); + return new( + GetConnectionOrDataSource: new($"var {connectionVar} = await GetDataSource().OpenConnectionAsync()", true) + // ConnectionOpen: string.Empty + ); + } + + public override string[] GetClassBaseTypes() + { + return ["IDisposable"]; + } + + public override string[] GetConstructorStatements() + { + var baseStatements = base.GetConstructorStatements(); + var dataSourceVar = Variable.DataSource.AsFieldName(); + var connectionStringVar = Variable.ConnectionString.AsVarName(); var optionalNotNullVerify = Options.DotnetFramework.IsDotnetCore() ? "!" : string.Empty; - return useOpenConnection - ? new ConnectionGenCommands( - $"var {connectionVar} = new NpgsqlConnection({connectionStringVar})", - string.Empty - ) - : new ConnectionGenCommands( - $"var {connectionVar} = NpgsqlDataSource.Create({connectionStringVar}{optionalNotNullVerify})", - string.Empty - ); + return + [ + .. baseStatements, + $""" + {dataSourceVar} = new Lazy(() => NpgsqlDataSource.Create({connectionStringVar}{optionalNotNullVerify}), LazyThreadSafetyMode.ExecutionAndPublication); + """, + ]; + } + + public override MemberDeclarationSyntax[] GetAdditionalClassMembers() + { + var dataSourceField = Variable.DataSource.AsFieldName(); + var optionalNotNullVerify = Options.DotnetFramework.IsDotnetCore() ? "?" : string.Empty; + + return [ + ParseMemberDeclaration($$""" + private readonly Lazy{{optionalNotNullVerify}} {{dataSourceField}}; + """)!, + ParseMemberDeclaration($$""" + private NpgsqlDataSource GetDataSource() + { + if ({{dataSourceField}} == null) + throw new InvalidOperationException("ConnectionString is required when not using a transaction"); + return {{dataSourceField}}.Value; + } + """)!, + ParseMemberDeclaration($$""" + public void Dispose() + { + GC.SuppressFinalize(this); + if ({{dataSourceField}}?.IsValueCreated == true) + {{dataSourceField}}.Value.Dispose(); + } + """)! + ]; } - public override string CreateSqlCommand(string sqlTextConstant) + public override CommandGenCommands CreateSqlCommand(string sqlTextConstant) { - return $"var {Variable.Command.AsVarName()} = {Variable.Connection.AsVarName()}.CreateCommand({sqlTextConstant})"; + var commandVar = Variable.Command.AsVarName(); + return new CommandGenCommands( + CommandCreation: new( + $"var {commandVar} = {Variable.Connection.AsVarName()}.CreateCommand()", + true), + SetCommandText: $"{commandVar}.CommandText = {sqlTextConstant}", + PrepareCommand: string.Empty + ); } public override string TransformQueryText(Query query) @@ -578,31 +624,32 @@ public override string TransformQueryText(Query query) string GetCopyCommand() { var copyParams = query.Params.Select(p => p.Column.Name).JoinByComma(); - return $"COPY {query.InsertIntoTable.Name} ({copyParams}) FROM STDIN (FORMAT BINARY)"; + var qualifiedTableName = !string.IsNullOrEmpty(query.InsertIntoTable.Schema) + ? $"{query.InsertIntoTable.Schema}.{query.InsertIntoTable.Name}" + : query.InsertIntoTable.Name; + return $"COPY {qualifiedTableName} ({copyParams}) FROM STDIN (FORMAT BINARY)"; } } public string GetCopyFromImpl(Query query, string queryTextConstant) { - var (establishConnection, connectionOpen) = EstablishConnection(query); + var connectionCommands = EstablishConnection(query); var beginBinaryImport = $"{Variable.Connection.AsVarName()}.BeginBinaryImportAsync({queryTextConstant}"; var connectionVar = Variable.Connection.AsVarName(); var writerVar = Variable.Writer.AsVarName(); - - var addRowsToCopyCommand = AddRowsToCopyCommand(); - return $$""" - using ({{establishConnection}}) - { - {{connectionOpen.AppendSemicolonUnlessEmpty()}} - await {{connectionVar}}.OpenAsync(); - using (var {{writerVar}} = await {{beginBinaryImport}})) - { - {{addRowsToCopyCommand}} - await {{writerVar}}.CompleteAsync(); - } - await {{connectionVar}}.CloseAsync(); - } - """; + var commandBlock = $$""" + using (var {{writerVar}} = await {{beginBinaryImport}})) + { + {{AddRowsToCopyCommand()}} + await {{writerVar}}.CompleteAsync(); + } + """; + return connectionCommands.GetConnectionOrDataSource.WrapBlock( + $$""" + {{connectionCommands.ConnectionOpen.AppendSemicolonUnlessEmpty()}} + {{commandBlock}} + """ + ); string AddRowsToCopyCommand() { @@ -636,19 +683,6 @@ string AddRowsToCopyCommand() } } - private string? GetColumnDbTypeOverride(Column column) - { - if (column.IsArray) - return null; // TODO: handle array columns - var columnType = column.Type.Name.ToLower(); - foreach (var columnMapping in ColumnMappings.Values) - { - if (columnMapping.DbTypes.TryGetValue(columnType, out var dbTypeOverride)) - return dbTypeOverride.NpgsqlTypeOverride; - } - return null; - } - public override WriterFn? GetWriterFn(Column column, Query query) { var csharpType = GetCsharpTypeWithoutNullableSuffix(column, query); @@ -677,13 +711,6 @@ public override string AddParametersToCommand(Query query) { var commandVar = Variable.Command.AsVarName(); var param = $"{Variable.Args.AsVarName()}.{p.Column.Name.ToPascalCase()}"; - - if (p.Column.IsSqlcSlice) - return $$""" - for (int i = 0; i < {{param}}.Length; i++) - {{commandVar}}.Parameters.AddWithValue($"@{{p.Column.Name}}Arg{i}", {{param}}[i]); - """; - var writerFn = GetWriterFn(p.Column, query); var paramToWrite = writerFn is null ? param @@ -695,10 +722,10 @@ public override string AddParametersToCommand(Query query) Options.DotnetFramework.IsDotnetLegacy()); var typeOverride = GetColumnDbTypeOverride(p.Column); - var optionalNpgsqlTypeOverride = typeOverride is null + var optionalTypeOverride = typeOverride is null ? string.Empty : $"{typeOverride}, "; - var addParamToCommand = $"""{commandVar}.Parameters.AddWithValue("@{p.Column.Name}", {optionalNpgsqlTypeOverride}{paramToWrite});"""; + var addParamToCommand = $"""{commandVar}.Parameters.AddWithValue("@{p.Column.Name}", {optionalTypeOverride}{paramToWrite});"""; return addParamToCommand; }).JoinByNewLine(); } diff --git a/Drivers/SqliteDriver.cs b/Drivers/SqliteDriver.cs index 6a981f68..092141bb 100644 --- a/Drivers/SqliteDriver.cs +++ b/Drivers/SqliteDriver.cs @@ -243,7 +243,7 @@ public MemberDeclarationSyntax CopyFromDeclare(string queryTextConstant, string public override MemberDeclarationSyntax[] GetMemberDeclarationsForUtils() { - return base + return [.. base .GetMemberDeclarationsForUtils() .AddRangeIf([ ParseMemberDeclaration(TransformQueryForSliceArgsImpl)! @@ -251,21 +251,30 @@ public override MemberDeclarationSyntax[] GetMemberDeclarationsForUtils() .AddRangeIf([ ParseMemberDeclaration(ValuesRegex)!, ParseMemberDeclaration(TransformQueryForBatch)! - ], CopyFromQueryExists()) - .ToArray(); + ], CopyFromQueryExists())]; } public override ConnectionGenCommands EstablishConnection(Query query) { return new( - $"var {Variable.Connection.AsVarName()} = new SqliteConnection({Variable.ConnectionString.AsPropertyName()})", - $"await {Variable.Connection.AsVarName()}.OpenAsync()" + GetConnectionOrDataSource: new( + $"var {Variable.Connection.AsVarName()} = new SqliteConnection({Variable.ConnectionString.AsPropertyName()})", + true + ), + ConnectionOpen: $"await {Variable.Connection.AsVarName()}.OpenAsync()" ); } - public override string CreateSqlCommand(string sqlTextConstant) + public override CommandGenCommands CreateSqlCommand(string sqlTextConstant) { - return $"var {Variable.Command.AsVarName()} = new SqliteCommand({sqlTextConstant}, {Variable.Connection.AsVarName()})"; + var commandVar = Variable.Command.AsVarName(); + return new CommandGenCommands( + CommandCreation: new( + $"var {commandVar} = new SqliteCommand({sqlTextConstant}, {Variable.Connection.AsVarName()})", + true), + SetCommandText: string.Empty, + PrepareCommand: string.Empty + ); } public override string TransformQueryText(Query query) @@ -295,24 +304,23 @@ public override string TransformQueryText(Query query) public string GetCopyFromImpl(Query query, string queryTextConstant) { var sqlTextVar = Variable.TransformedSql.AsVarName(); - var (establishConnection, connectionOpen) = EstablishConnection(query); - var sqlTransformation = $"var {sqlTextVar} = Utils.TransformQueryForSqliteBatch({queryTextConstant}, {Variable.Args.AsVarName()}.Count);"; + var connectionCommands = EstablishConnection(query); var commandParameters = AddParametersToCommand(); - var createSqlCommand = CreateSqlCommand(sqlTextVar); - var executeScalar = $"await {Variable.Command.AsVarName()}.ExecuteScalarAsync();"; - - return $$""" - using ({{establishConnection}}) - { - {{connectionOpen.AppendSemicolonUnlessEmpty()}} - {{sqlTransformation}} - using ({{createSqlCommand}}) - { - {{commandParameters}} - {{executeScalar}} - } - } - """; + var createSqlCommands = CreateSqlCommand(sqlTextVar); + var commandBlock = createSqlCommands.CommandCreation.WrapBlock( + $""" + {commandParameters} + {createSqlCommands.PrepareCommand.AppendSemicolonUnlessEmpty()} + await {Variable.Command.AsVarName()}.ExecuteScalarAsync(); + """ + ); + return connectionCommands.GetConnectionOrDataSource.WrapBlock( + $$""" + var {{sqlTextVar}} = Utils.TransformQueryForSqliteBatch({{queryTextConstant}}, {{Variable.Args.AsVarName()}}.Count); + {{connectionCommands.ConnectionOpen.AppendSemicolonUnlessEmpty()}} + {{commandBlock}} + """ + ); string AddParametersToCommand() { diff --git a/Drivers/Variable.cs b/Drivers/Variable.cs index b6fd98d6..59ceca91 100644 --- a/Drivers/Variable.cs +++ b/Drivers/Variable.cs @@ -6,6 +6,7 @@ public enum Variable Config, ConnectionString, Transaction, + DataSource, Connection, Command, @@ -20,7 +21,7 @@ public enum Variable QueryParams, TransformedSql, Row, - Result + Result, } public static class VariablesExtensions @@ -34,4 +35,9 @@ public static string AsPropertyName(this Variable me) { return me.ToString().ToPascalCase(); } + + public static string AsFieldName(this Variable me) + { + return $"_{me.AsVarName()}"; + } } \ No newline at end of file diff --git a/Extensions/NumberExtensions.cs b/Extensions/NumberExtensions.cs new file mode 100644 index 00000000..30dce1b5 --- /dev/null +++ b/Extensions/NumberExtensions.cs @@ -0,0 +1,26 @@ +namespace SqlcGenCsharp; + +public static class NumberExtensions +{ + public static string StringifyLargeNumbers(this int value) + { + if (value < 1_000) return value.ToString(); + + if (value < 1_000_000) + return FormatWithSuffix(value / 1_000, "K"); // Thousands: 1000-999999 + + if (value < 1_000_000_000) + return FormatWithSuffix(value / 1_000_000, "M"); // Millions: 1000000-999999999 + + return FormatWithSuffix(value / 1_000_000_000, "B"); // Billions: 1000000000+ + } + + private static string FormatWithSuffix(double value, string suffix) + { + if (value % 1 == 0) + return $"{(int)value}{suffix}"; + + var formatted = $"{value:F1}{suffix}"; + return formatted.EndsWith(".0" + suffix) ? $"{(int)value}{suffix}" : formatted; + } +} \ No newline at end of file diff --git a/Makefile b/Makefile index 52736dcc..5e223c9c 100644 --- a/Makefile +++ b/Makefile @@ -12,9 +12,6 @@ unit-tests: generate-end2end-tests: ./end2end/scripts/generate_tests.sh - -run-end2end-tests: - ./end2end/scripts/run_tests.sh # process type plugin dotnet-publish-process: @@ -32,14 +29,51 @@ sqlc-generate: sync-sqlc-options dotnet-publish-process sqlc-generate-requests test-plugin: unit-tests sqlc-generate generate-end2end-tests dotnet-build run-end2end-tests # WASM type plugin -setup-ci-wasm-plugin: +# Source files that should trigger a rebuild +WASM_SOURCES := $(shell find WasmRunner -name '*.cs' -o -name '*.csproj' 2>/dev/null | grep -v '/bin/' | grep -v '/obj/') \ + $(shell find SqlcGenCsharp -name '*.cs' -o -name '*.csproj' 2>/dev/null | grep -v '/bin/' | grep -v '/obj/' || true) + +# Final output file - this is what we check for caching +WASM_PLUGIN_OUTPUT := dist/plugin.wasm + +# Make setup-wasm-plugin depend on the actual output file (not phony) +setup-wasm-plugin: $(WASM_PLUGIN_OUTPUT) + @echo "WASM plugin is up to date" + +# Build and copy plugin if output doesn't exist or sources are newer +$(WASM_PLUGIN_OUTPUT): $(WASM_SOURCES) dotnet publish WasmRunner -c release --output dist/ ./scripts/wasm/copy_plugin_to.sh dist ./scripts/wasm/update_sha.sh sqlc.ci.yaml +run-end2end-tests: + ./end2end/scripts/run_tests.sh + +# Benchmarks +run-benchmark-sqlite-reads: sqlc-generate + ./benchmark/scripts/run_single_benchmark.sh sqlite reads + +run-benchmark-sqlite-writes: sqlc-generate + ./benchmark/scripts/run_single_benchmark.sh sqlite writes + +run-benchmark-postgresql-reads: sqlc-generate + ./benchmark/scripts/run_single_benchmark.sh postgresql reads + +run-benchmark-postgresql-writes: sqlc-generate + ./benchmark/scripts/run_single_benchmark.sh postgresql writes + +run-benchmark-mysql-reads: sqlc-generate + ./benchmark/scripts/run_single_benchmark.sh mysql reads + +run-benchmark-mysql-writes: sqlc-generate + ./benchmark/scripts/run_single_benchmark.sh mysql writes + # Manual generate-protobuf: ./scripts/generate_protobuf.sh dotnet-format: - dotnet format --exclude GeneratedProtobuf --exclude examples \ No newline at end of file + dotnet format \ + --exclude GeneratedProtobuf \ + --exclude examples \ + --exclude benchmark/*SqlcImpl diff --git a/PluginOptions/Options.cs b/PluginOptions/Options.cs index 4bf774ea..65c06c58 100644 --- a/PluginOptions/Options.cs +++ b/PluginOptions/Options.cs @@ -11,10 +11,8 @@ public class Options public Options(GenerateRequest generateRequest) { var text = Encoding.UTF8.GetString(generateRequest.PluginOptions.ToByteArray()); - // handle empty options case - if (text.Trim() == string.Empty) + if (NoOptionsProvided(text)) text = "{}"; - var rawOptions = JsonSerializer.Deserialize(text) ?? throw new InvalidOperationException(); DriverName = EngineToDriverMapping[generateRequest.Settings.Engine]; @@ -26,12 +24,11 @@ public Options(GenerateRequest generateRequest) DotnetFramework = DotnetFrameworkExtensions.ParseName(rawOptions.TargetFramework); Overrides = rawOptions.Overrides ?? []; WithAsyncSuffix = rawOptions.WithAsyncSuffix; + UseCentralPackageManagement = rawOptions.UseCentralPackageManagement; if (rawOptions.DebugRequest && generateRequest.Settings.Codegen.Wasm is not null) throw new ArgumentException("Debug request mode cannot be used with WASM plugin"); DebugRequest = rawOptions.DebugRequest; - - UseCentralPackageManagement = rawOptions.UseCentralPackageManagement; } public DriverName DriverName { get; } @@ -66,4 +63,9 @@ public Options(GenerateRequest generateRequest) { "postgresql", DriverName.Npgsql }, { "sqlite", DriverName.Sqlite } }; + + private static bool NoOptionsProvided(string optionsText) + { + return optionsText.Trim() == string.Empty; + } } \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/BenchmarkRunner.csproj b/benchmark/BenchmarkRunner/BenchmarkRunner.csproj new file mode 100644 index 00000000..34a01a45 --- /dev/null +++ b/benchmark/BenchmarkRunner/BenchmarkRunner.csproj @@ -0,0 +1,42 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + diff --git a/benchmark/BenchmarkRunner/Benchmarks/BaseReadBenchmark.cs b/benchmark/BenchmarkRunner/Benchmarks/BaseReadBenchmark.cs new file mode 100644 index 00000000..207275ff --- /dev/null +++ b/benchmark/BenchmarkRunner/Benchmarks/BaseReadBenchmark.cs @@ -0,0 +1,65 @@ +using BenchmarkDotNet.Attributes; +using BenchmarkRunner.Utils; +using SqlcGenCsharp; + +public readonly record struct ReadBenchmarkParams( + int Limit, + int Concurrency, + int QueriesToSubmit +) +{ + public override string ToString() => $"L={Limit.StringifyLargeNumbers()}, C={Concurrency.StringifyLargeNumbers()}, Q={QueriesToSubmit.StringifyLargeNumbers()}"; +} + +public abstract class BaseReadBenchmark +{ + [IterationSetup] + public static void IterationSetup() => Helpers.InvokeGarbageCollection(); + public abstract Task Sqlc_GetCustomerOrders(); + public abstract Task EFCore_NoTracking_GetCustomerOrders(); + public abstract Task EFCore_WithTracking_GetCustomerOrders(); + public static DatabaseSeedConfig GetSeedConfig() => new( + CustomerCount: 500, + ProductsPerCategory: 150, + OrdersPerCustomer: 500, + ItemsPerOrder: 20 + ); + private static int CalculateMaxConcurrency(int totalTasks, int maxConcurrency) + { + return new int[] { + maxConcurrency, totalTasks, Environment.ProcessorCount + }.Min(x => x); + } + protected static async Task> ExecuteConcurrentlyAsync( + int totalTasks, + int maxConcurrency, + Func>> taskFactory) + { + maxConcurrency = CalculateMaxConcurrency(totalTasks, maxConcurrency); + using var semaphore = new SemaphoreSlim(maxConcurrency, maxConcurrency); + var tasks = new List>>(); + for (int i = 0; i < totalTasks; i++) + { + var index = i; // Capture for closure + tasks.Add(ExecuteWithThrottleAsync(semaphore, () => taskFactory(index))); + } + + var results = await Task.WhenAll([.. tasks]); + return [.. results.SelectMany(r => r)]; + } + + private static async Task> ExecuteWithThrottleAsync( + SemaphoreSlim semaphore, + Func>> taskFactory) + { + await semaphore.WaitAsync(); + try + { + return await taskFactory(); + } + finally + { + semaphore.Release(); + } + } +} \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/Benchmarks/BaseWriteBenchmark.cs b/benchmark/BenchmarkRunner/Benchmarks/BaseWriteBenchmark.cs new file mode 100644 index 00000000..2cc1b803 --- /dev/null +++ b/benchmark/BenchmarkRunner/Benchmarks/BaseWriteBenchmark.cs @@ -0,0 +1,26 @@ +using SqlcGenCsharp; + +public readonly record struct WriteBenchmarkArgs( + int TotalRecordsToLoad, + int BatchSize +) +{ + public override string ToString() => $"R={TotalRecordsToLoad.StringifyLargeNumbers()}, B={BatchSize.StringifyLargeNumbers()}"; +} + +public abstract class BaseWriteBenchmark +{ + public const int TotalRecordsForSetup = 300000; // 3 million records + public const int OrderIdsCountForSetup = 1000; + public const int ProductIdsCountForSetup = 1000; + + public static DatabaseSeedConfig GetSeedConfig() => new( + CustomerCount: 500, + ProductsPerCategory: 150, + OrdersPerCustomer: 500, + ItemsPerOrder: 0 + ); + + public abstract Task Sqlc_AddOrderItems(WriteBenchmarkArgs args); + public abstract Task EFCore_AddOrderItems(WriteBenchmarkArgs args); +} \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/Benchmarks/MysqlReadBenchmark.cs b/benchmark/BenchmarkRunner/Benchmarks/MysqlReadBenchmark.cs new file mode 100644 index 00000000..7eacbe77 --- /dev/null +++ b/benchmark/BenchmarkRunner/Benchmarks/MysqlReadBenchmark.cs @@ -0,0 +1,93 @@ +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Jobs; +using BenchmarkRunner.Utils; +using MysqlEFCoreImpl; +using MysqlSqlcImpl; +using NUnit.Framework; + +namespace BenchmarkRunner.Benchmarks; + +[SimpleJob(RuntimeMoniker.Net80, warmupCount: 2, iterationCount: 10)] +[MemoryDiagnoser] +[MarkdownExporterAttribute.GitHub] +[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] +[CategoriesColumn] +public class MysqlReadBenchmark : BaseReadBenchmark +{ + private static readonly string _connectionString = Config.GetMysqlConnectionString(); + private readonly QuerySql _sqlcImpl = new(_connectionString); + + public static IEnumerable GetParams() + { + yield return new ReadBenchmarkParams(Limit: 50, Concurrency: 200, QueriesToSubmit: 4000); + yield return new ReadBenchmarkParams(Limit: 1000, Concurrency: 100, QueriesToSubmit: 2000); + } + + [ParamsSource(nameof(GetParams))] + public ReadBenchmarkParams Params { get; set; } + + [BenchmarkCategory("Read")] + [Benchmark(Baseline = true, Description = "SQLC - GetCustomerOrders")] + public override async Task Sqlc_GetCustomerOrders() + { + await ExecuteConcurrentlyAsync(Params.QueriesToSubmit, Params.Concurrency, async _ => + { + var results = await _sqlcImpl.GetCustomerOrdersAsync(new QuerySql.GetCustomerOrdersArgs( + CustomerId: Random.Shared.Next(1, GetSeedConfig().CustomerCount), + Offset: 0, + Limit: Params.Limit + )); + + Assert.That(results.Count, Is.EqualTo(Params.Limit)); + return results; + }); + } + + [BenchmarkCategory("Read")] + [Benchmark(Description = "EFCore (NoTracking) - GetCustomerOrders")] + public override async Task EFCore_NoTracking_GetCustomerOrders() + { + await ExecuteConcurrentlyAsync(Params.QueriesToSubmit, Params.Concurrency, async _ => + { + await using var dbContext = new SalesDbContext(_connectionString); + var queries = new Queries(dbContext, useTracking: false); + var results = await queries.GetCustomerOrders(new Queries.GetCustomerOrdersArgs( + CustomerId: Random.Shared.Next(1, GetSeedConfig().CustomerCount), + Offset: 0, + Limit: Params.Limit + )); + + Assert.That(results.Count, Is.EqualTo(Params.Limit)); + return results; + }); + } + + [BenchmarkCategory("Read")] + [Benchmark(Description = "EFCore (WithTracking) - GetCustomerOrders")] + public override async Task EFCore_WithTracking_GetCustomerOrders() + { + await ExecuteConcurrentlyAsync(Params.QueriesToSubmit, Params.Concurrency, async _ => + { + await using var dbContext = new SalesDbContext(_connectionString); + var queries = new Queries(dbContext, useTracking: true); + var results = await queries.GetCustomerOrders(new Queries.GetCustomerOrdersArgs( + CustomerId: Random.Shared.Next(1, GetSeedConfig().CustomerCount), + Offset: 0, + Limit: Params.Limit + )); + + Assert.That(results.Count, Is.EqualTo(Params.Limit)); + return results; + }); + } + + public static Func GetSeedMethod() + { + return async () => + { + var seeder = new MysqlSeeder(_connectionString); + await seeder.SeedAsync(GetSeedConfig()); + }; + } +} \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/Benchmarks/MysqlWriteBenchmark.cs b/benchmark/BenchmarkRunner/Benchmarks/MysqlWriteBenchmark.cs new file mode 100644 index 00000000..f5ab034d --- /dev/null +++ b/benchmark/BenchmarkRunner/Benchmarks/MysqlWriteBenchmark.cs @@ -0,0 +1,114 @@ + +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Jobs; +using BenchmarkRunner.Utils; +using MySqlConnector; +using MysqlEFCoreImpl; +using MysqlSqlcImpl; +using NUnit.Framework; + +namespace BenchmarkRunner.Benchmarks; + +[SimpleJob(RuntimeMoniker.Net80, warmupCount: 2, iterationCount: 10)] +[MemoryDiagnoser] +[MarkdownExporterAttribute.GitHub] +[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] +[CategoriesColumn] +public class MysqlWriteBenchmark : BaseWriteBenchmark +{ + private static readonly string _connectionString = Config.GetMysqlConnectionString(); + private readonly QuerySql _sqlcImpl = new(_connectionString); + private readonly Queries _efCoreImpl = new(new SalesDbContext(_connectionString), useTracking: false); + + private List _sqlcTestOrderItems = null!; + private List _efCoreTestOrderItems = null!; + + public static IEnumerable GetSqlcArguments() + { + yield return new WriteBenchmarkArgs(TotalRecordsToLoad: TotalRecordsForSetup, BatchSize: 1000); + yield return new WriteBenchmarkArgs(TotalRecordsToLoad: TotalRecordsForSetup, BatchSize: 5000); + } + + [BenchmarkCategory("Write")] + [Benchmark(Baseline = true, Description = "SQLC - AddOrderItems")] + [ArgumentsSource(nameof(GetSqlcArguments))] + public override async Task Sqlc_AddOrderItems(WriteBenchmarkArgs args) + { + await Helpers.InsertInBatchesAsync(_sqlcTestOrderItems[..args.TotalRecordsToLoad], args.BatchSize, _sqlcImpl.AddOrderItemsAsync); + var result = await _sqlcImpl.GetOrderItemsCountAsync(); + Assert.That(result?.Cnt, Is.EqualTo(args.TotalRecordsToLoad)); + } + + public static IEnumerable GetEFCoreArguments() + { + yield return new WriteBenchmarkArgs(TotalRecordsToLoad: TotalRecordsForSetup, BatchSize: 500); + } + + [BenchmarkCategory("Write")] + [Benchmark(Description = "EFCore - AddOrderItems")] + [ArgumentsSource(nameof(GetEFCoreArguments))] + public override async Task EFCore_AddOrderItems(WriteBenchmarkArgs args) + { + await Helpers.InsertInBatchesAsync(_efCoreTestOrderItems[..args.TotalRecordsToLoad], args.BatchSize, _efCoreImpl.AddOrderItems); + var result = await _sqlcImpl.GetOrderItemsCountAsync(); + Assert.That(result?.Cnt, Is.EqualTo(args.TotalRecordsToLoad)); + } + + public static Func GetSeedMethod() + { + return async () => + { + var seeder = new MysqlSeeder(_connectionString); + await seeder.SeedAsync(GetSeedConfig()); + }; + } + + [GlobalSetup] + public async Task GlobalSetup() + { + var orderIds = await _sqlcImpl.GetOrderIdsAsync(new QuerySql.GetOrderIdsArgs(Limit: OrderIdsCountForSetup)); + var productIds = await _sqlcImpl.GetProductIdsAsync(new QuerySql.GetProductIdsArgs(Limit: ProductIdsCountForSetup)); + _sqlcTestOrderItems = GetSqlcTestOrderItemsAsync(orderIds, productIds); + _efCoreTestOrderItems = GetEFCoreTestOrderItems(orderIds, productIds); + } + + [IterationSetup] + public static void IterationSetup() + { + CleanupWriteTableAsync(_connectionString).GetAwaiter().GetResult(); + Helpers.InvokeGarbageCollection(); + } + + private static List GetSqlcTestOrderItemsAsync( + List orderIds, + List productIds) + { + return [.. Enumerable.Range(0, TotalRecordsForSetup).Select(i => new QuerySql.AddOrderItemsArgs( + OrderId: orderIds[i % OrderIdsCountForSetup].OrderId, + ProductId: productIds[i % ProductIdsCountForSetup].ProductId, + Quantity: Random.Shared.Next(1, 10), + UnitPrice: (decimal)(Random.Shared.NextDouble() * 100 + 5) + ))]; + } + + private static List GetEFCoreTestOrderItems( + List orderIds, + List productIds) + { + return [.. Enumerable.Range(0, TotalRecordsForSetup).Select(i => new Queries.AddOrderItemsArgs( + OrderId: orderIds[i % OrderIdsCountForSetup].OrderId, + ProductId: productIds[i % ProductIdsCountForSetup].ProductId, + Quantity: Random.Shared.Next(1, 10), + UnitPrice: (decimal)(Random.Shared.NextDouble() * 100 + 5) + ))]; + } + + private static async Task CleanupWriteTableAsync(string connectionString) + { + using var connection = new MySqlConnection(connectionString); + await connection.OpenAsync(); + using var cmd = new MySqlCommand("TRUNCATE TABLE sales.order_items", connection); + await cmd.ExecuteNonQueryAsync(); + } +} \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/Benchmarks/PostgresqlReadBenchmark.cs b/benchmark/BenchmarkRunner/Benchmarks/PostgresqlReadBenchmark.cs new file mode 100644 index 00000000..e0f5153d --- /dev/null +++ b/benchmark/BenchmarkRunner/Benchmarks/PostgresqlReadBenchmark.cs @@ -0,0 +1,93 @@ +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Jobs; +using BenchmarkRunner.Utils; +using NUnit.Framework; +using PostgresEFCoreImpl; +using PostgresSqlcImpl; + +namespace BenchmarkRunner.Benchmarks; + +[SimpleJob(RuntimeMoniker.Net80, warmupCount: 2, iterationCount: 10)] +[MemoryDiagnoser] +[MarkdownExporterAttribute.GitHub] +[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] +[CategoriesColumn] +public class PostgresqlReadBenchmark : BaseReadBenchmark +{ + private static readonly string _connectionString = Config.GetPostgresConnectionString(); + private readonly QuerySql _sqlcImpl = new(_connectionString); + + public static IEnumerable GetParams() + { + yield return new ReadBenchmarkParams(Limit: 50, Concurrency: 150, QueriesToSubmit: 4000); + yield return new ReadBenchmarkParams(Limit: 1000, Concurrency: 75, QueriesToSubmit: 2000); + } + + [ParamsSource(nameof(GetParams))] + public ReadBenchmarkParams Params { get; set; } + + [BenchmarkCategory("Read")] + [Benchmark(Baseline = true, Description = "SQLC - GetCustomerOrders")] + public override async Task Sqlc_GetCustomerOrders() + { + await ExecuteConcurrentlyAsync(Params.QueriesToSubmit, Params.Concurrency, async _ => + { + var results = await _sqlcImpl.GetCustomerOrdersAsync(new QuerySql.GetCustomerOrdersArgs( + CustomerId: Random.Shared.Next(1, GetSeedConfig().CustomerCount), + Offset: 0, + Limit: Params.Limit + )); + + Assert.That(results.Count, Is.EqualTo(Params.Limit)); + return results; + }); + } + + [BenchmarkCategory("Read")] + [Benchmark(Description = "EFCore (NoTracking) - GetCustomerOrders")] + public override async Task EFCore_NoTracking_GetCustomerOrders() + { + await ExecuteConcurrentlyAsync(Params.QueriesToSubmit, Params.Concurrency, async _ => + { + await using var dbContext = new SalesDbContext(_connectionString); + var queries = new Queries(dbContext, useTracking: false); + var results = await queries.GetCustomerOrders(new Queries.GetCustomerOrdersArgs( + CustomerId: Random.Shared.Next(1, GetSeedConfig().CustomerCount), + Offset: 0, + Limit: Params.Limit + )); + + Assert.That(results.Count, Is.EqualTo(Params.Limit)); + return results; + }); + } + + [BenchmarkCategory("Read")] + [Benchmark(Description = "EFCore (WithTracking) - GetCustomerOrders")] + public override async Task EFCore_WithTracking_GetCustomerOrders() + { + await ExecuteConcurrentlyAsync(Params.QueriesToSubmit, Params.Concurrency, async _ => + { + await using var dbContext = new SalesDbContext(_connectionString); + var queries = new Queries(dbContext, useTracking: true); + var results = await queries.GetCustomerOrders(new Queries.GetCustomerOrdersArgs( + CustomerId: Random.Shared.Next(1, GetSeedConfig().CustomerCount), + Offset: 0, + Limit: Params.Limit + )); + + Assert.That(results.Count, Is.EqualTo(Params.Limit)); + return results; + }); + } + + public static Func GetSeedMethod() + { + return async () => + { + var seeder = new PostgresqlSeeder(_connectionString); + await seeder.SeedAsync(GetSeedConfig()); + }; + } +} \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/Benchmarks/PostgresqlWriteBenchmark.cs b/benchmark/BenchmarkRunner/Benchmarks/PostgresqlWriteBenchmark.cs new file mode 100644 index 00000000..285c1312 --- /dev/null +++ b/benchmark/BenchmarkRunner/Benchmarks/PostgresqlWriteBenchmark.cs @@ -0,0 +1,112 @@ +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Jobs; +using BenchmarkRunner.Utils; +using Npgsql; +using NUnit.Framework; +using PostgresEFCoreImpl; +using PostgresSqlcImpl; + +namespace BenchmarkRunner.Benchmarks; + +[SimpleJob(RuntimeMoniker.Net80, warmupCount: 2, iterationCount: 10)] +[MemoryDiagnoser] +[MarkdownExporterAttribute.GitHub] +[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] +[CategoriesColumn] +public class PostgresqlWriteBenchmark : BaseWriteBenchmark +{ + private static readonly string _connectionString = Config.GetPostgresConnectionString(); + private readonly QuerySql _sqlcImpl = new(_connectionString); + private readonly Queries _efCoreImpl = new(new SalesDbContext(_connectionString), useTracking: false); + private List _sqlcTestOrderItems = null!; + private List _efCoreTestOrderItems = null!; + + public static IEnumerable GetSqlcArguments() + { + yield return new WriteBenchmarkArgs(TotalRecordsToLoad: TotalRecordsForSetup, BatchSize: 1000); + yield return new WriteBenchmarkArgs(TotalRecordsToLoad: TotalRecordsForSetup, BatchSize: 2000); + } + + [BenchmarkCategory("Write")] + [Benchmark(Baseline = true, Description = "SQLC - AddOrderItems")] + [ArgumentsSource(nameof(GetSqlcArguments))] + public override async Task Sqlc_AddOrderItems(WriteBenchmarkArgs args) + { + await Helpers.InsertInBatchesAsync(_sqlcTestOrderItems[..args.TotalRecordsToLoad], args.BatchSize, _sqlcImpl.AddOrderItemsAsync); + var result = await _sqlcImpl.GetOrderItemsCountAsync(); + Assert.That(result?.Cnt, Is.EqualTo(args.TotalRecordsToLoad)); + } + + public static IEnumerable GetEFCoreArguments() + { + yield return new WriteBenchmarkArgs(TotalRecordsToLoad: TotalRecordsForSetup, BatchSize: 500); + } + + [BenchmarkCategory("Write")] + [Benchmark(Description = "EFCore - AddOrderItems")] + [ArgumentsSource(nameof(GetEFCoreArguments))] + public override async Task EFCore_AddOrderItems(WriteBenchmarkArgs args) + { + await Helpers.InsertInBatchesAsync(_efCoreTestOrderItems[..args.TotalRecordsToLoad], args.BatchSize, _efCoreImpl.AddOrderItems); + var result = await _sqlcImpl.GetOrderItemsCountAsync(); + Assert.That(result?.Cnt, Is.EqualTo(args.TotalRecordsToLoad)); + } + + public static Func GetSeedMethod() + { + return async () => + { + var seeder = new PostgresqlSeeder(_connectionString); + await seeder.SeedAsync(GetSeedConfig()); + }; + } + + [GlobalSetup] + public async Task GlobalSetup() + { + var orderIds = await _sqlcImpl.GetOrderIdsAsync(new QuerySql.GetOrderIdsArgs(Limit: OrderIdsCountForSetup)); + var productIds = await _sqlcImpl.GetProductIdsAsync(new QuerySql.GetProductIdsArgs(Limit: ProductIdsCountForSetup)); + _sqlcTestOrderItems = GetSqlcTestOrderItemsAsync(orderIds, productIds); + _efCoreTestOrderItems = GetEFCoreTestOrderItems(orderIds, productIds); + } + + [IterationSetup] + public static void IterationSetup() + { + CleanupWriteTableAsync(_connectionString).GetAwaiter().GetResult(); + Helpers.InvokeGarbageCollection(); + } + + private static List GetSqlcTestOrderItemsAsync( + List orderIds, + List productIds) + { + return [.. Enumerable.Range(0, TotalRecordsForSetup).Select(i => new QuerySql.AddOrderItemsArgs( + OrderId: orderIds[i % OrderIdsCountForSetup].OrderId, + ProductId: productIds[i % ProductIdsCountForSetup].ProductId, + Quantity: Random.Shared.Next(1, 10), + UnitPrice: (decimal)(Random.Shared.NextDouble() * 100 + 5) + ))]; + } + + private static List GetEFCoreTestOrderItems( + List orderIds, + List productIds) + { + return [.. Enumerable.Range(0, TotalRecordsForSetup).Select(i => new Queries.AddOrderItemsArgs( + OrderId: orderIds[i % OrderIdsCountForSetup].OrderId, + ProductId: productIds[i % ProductIdsCountForSetup].ProductId, + Quantity: Random.Shared.Next(1, 10), + UnitPrice: (decimal)(Random.Shared.NextDouble() * 100 + 5) + ))]; + } + + private static async Task CleanupWriteTableAsync(string connectionString) + { + using var connection = new NpgsqlConnection(connectionString); + await connection.OpenAsync(); + using var cmd = new NpgsqlCommand("TRUNCATE TABLE sales.order_items", connection); + await cmd.ExecuteNonQueryAsync(); + } +} \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/Benchmarks/SqliteReadBenchmark.cs b/benchmark/BenchmarkRunner/Benchmarks/SqliteReadBenchmark.cs new file mode 100644 index 00000000..80683a38 --- /dev/null +++ b/benchmark/BenchmarkRunner/Benchmarks/SqliteReadBenchmark.cs @@ -0,0 +1,95 @@ +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Jobs; +using BenchmarkRunner.Utils; +using EndToEndTests; +using NUnit.Framework; +using SqliteEFCoreImpl; +using SqliteSqlcImpl; + +namespace BenchmarkRunner.Benchmarks; + +[SimpleJob(RuntimeMoniker.Net80, warmupCount: 2, iterationCount: 10)] +[MemoryDiagnoser] +[MarkdownExporterAttribute.GitHub] +[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] +[CategoriesColumn] +public class SqliteReadBenchmark : BaseReadBenchmark +{ + private static readonly string _connectionString = Config.GetSqliteConnectionString(); + private readonly QuerySql _sqlcImpl = new(_connectionString); + + public static IEnumerable GetParams() + { + yield return new ReadBenchmarkParams(Limit: 50, Concurrency: 100, QueriesToSubmit: 3000); + yield return new ReadBenchmarkParams(Limit: 1000, Concurrency: 50, QueriesToSubmit: 1500); + } + + [ParamsSource(nameof(GetParams))] + public ReadBenchmarkParams Params { get; set; } + + [BenchmarkCategory("Read")] + [Benchmark(Baseline = true, Description = "SQLC - GetCustomerOrders")] + public override async Task Sqlc_GetCustomerOrders() + { + await ExecuteConcurrentlyAsync(Params.QueriesToSubmit, Params.Concurrency, async _ => + { + var results = await _sqlcImpl.GetCustomerOrdersAsync(new QuerySql.GetCustomerOrdersArgs( + CustomerId: Random.Shared.Next(1, GetSeedConfig().CustomerCount), + Offset: 0, + Limit: Params.Limit + )); + + Assert.That(results.Count, Is.EqualTo(Params.Limit)); + return results; + }); + } + + [BenchmarkCategory("Read")] + [Benchmark(Description = "EFCore (NoTracking) - GetCustomerOrders")] + public override async Task EFCore_NoTracking_GetCustomerOrders() + { + await ExecuteConcurrentlyAsync(Params.QueriesToSubmit, Params.Concurrency, async _ => + { + await using var dbContext = new SalesDbContext(_connectionString); + var queries = new Queries(dbContext, useTracking: false); + var results = await queries.GetCustomerOrders(new Queries.GetCustomerOrdersArgs( + CustomerId: Random.Shared.Next(1, GetSeedConfig().CustomerCount), + Offset: 0, + Limit: Params.Limit + )); + + Assert.That(results.Count, Is.EqualTo(Params.Limit)); + return results; + }); + } + + [BenchmarkCategory("Read")] + [Benchmark(Description = "EFCore (WithTracking) - GetCustomerOrders")] + public override async Task EFCore_WithTracking_GetCustomerOrders() + { + await ExecuteConcurrentlyAsync(Params.QueriesToSubmit, Params.Concurrency, async _ => + { + await using var dbContext = new SalesDbContext(_connectionString); + var queries = new Queries(dbContext, useTracking: true); + var results = await queries.GetCustomerOrders(new Queries.GetCustomerOrdersArgs( + CustomerId: Random.Shared.Next(1, GetSeedConfig().CustomerCount), + Offset: 0, + Limit: Params.Limit + )); + + Assert.That(results.Count, Is.EqualTo(Params.Limit)); + return results; + }); + } + + public static Func GetSeedMethod() + { + return async () => + { + EndToEndCommon.SetupBenchmarkSqliteDb(); + var seeder = new SqliteSeeder(_connectionString); + await seeder.SeedAsync(GetSeedConfig()); + }; + } +} \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/Benchmarks/SqliteWriteBenchmark.cs b/benchmark/BenchmarkRunner/Benchmarks/SqliteWriteBenchmark.cs new file mode 100644 index 00000000..9ba3fc0e --- /dev/null +++ b/benchmark/BenchmarkRunner/Benchmarks/SqliteWriteBenchmark.cs @@ -0,0 +1,114 @@ +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Jobs; +using BenchmarkRunner.Utils; +using EndToEndTests; +using Microsoft.Data.Sqlite; +using NUnit.Framework; +using SqliteEFCoreImpl; +using SqliteSqlcImpl; + +namespace BenchmarkRunner.Benchmarks; + +[SimpleJob(RuntimeMoniker.Net80, warmupCount: 2, iterationCount: 10)] +[MemoryDiagnoser] +[MarkdownExporterAttribute.GitHub] +[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] +[CategoriesColumn] +public class SqliteWriteBenchmark : BaseWriteBenchmark +{ + private static readonly string _connectionString = Config.GetSqliteConnectionString(); + private readonly QuerySql _sqlcImpl = new(_connectionString); + private readonly Queries _efCoreImpl = new(new SalesDbContext(_connectionString), useTracking: false); + private List _sqlcTestOrderItems = null!; + private List _efCoreTestOrderItems = null!; + + public static IEnumerable GetSqlcArguments() + { + yield return new WriteBenchmarkArgs(TotalRecordsToLoad: TotalRecordsForSetup, BatchSize: 50); + yield return new WriteBenchmarkArgs(TotalRecordsToLoad: TotalRecordsForSetup, BatchSize: 100); + } + + [BenchmarkCategory("Write")] + [Benchmark(Baseline = true, Description = "SQLC - AddOrderItems")] + [ArgumentsSource(nameof(GetSqlcArguments))] + public override async Task Sqlc_AddOrderItems(WriteBenchmarkArgs args) + { + await Helpers.InsertInBatchesAsync(_sqlcTestOrderItems[..args.TotalRecordsToLoad], args.BatchSize, _sqlcImpl.AddOrderItemsAsync); + var result = await _sqlcImpl.GetOrderItemsCountAsync(); + Assert.That(result?.Cnt, Is.EqualTo(args.TotalRecordsToLoad)); + } + + public static IEnumerable GetEFCoreArguments() + { + yield return new WriteBenchmarkArgs(TotalRecordsToLoad: TotalRecordsForSetup, BatchSize: 500); + } + + [BenchmarkCategory("Write")] + [Benchmark(Description = "EFCore - AddOrderItems")] + [ArgumentsSource(nameof(GetEFCoreArguments))] + public override async Task EFCore_AddOrderItems(WriteBenchmarkArgs args) + { + await Helpers.InsertInBatchesAsync(_efCoreTestOrderItems[..args.TotalRecordsToLoad], args.BatchSize, _efCoreImpl.AddOrderItems); + var result = await _sqlcImpl.GetOrderItemsCountAsync(); + Assert.That(result?.Cnt, Is.EqualTo(args.TotalRecordsToLoad)); + } + + public static Func GetSeedMethod() + { + return async () => + { + EndToEndCommon.SetupBenchmarkSqliteDb(); + var seeder = new SqliteSeeder(_connectionString); + await seeder.SeedAsync(GetSeedConfig()); + }; + } + + [GlobalSetup] + public async Task GlobalSetup() + { + var orderIds = await _sqlcImpl.GetOrderIdsAsync(new QuerySql.GetOrderIdsArgs(Limit: OrderIdsCountForSetup)); + var productIds = await _sqlcImpl.GetProductIdsAsync(new QuerySql.GetProductIdsArgs(Limit: ProductIdsCountForSetup)); + _sqlcTestOrderItems = GetSqlcTestOrderItemsAsync(orderIds, productIds); + _efCoreTestOrderItems = GetEFCoreTestOrderItems(orderIds, productIds); + } + + [IterationSetup] + public static void IterationSetup() + { + CleanupWriteTableAsync(_connectionString).GetAwaiter().GetResult(); + Helpers.InvokeGarbageCollection(); + } + + private static List GetSqlcTestOrderItemsAsync( + List orderIds, + List productIds) + { + return [.. Enumerable.Range(0, TotalRecordsForSetup).Select(i => new QuerySql.AddOrderItemsArgs( + OrderId: orderIds[i % OrderIdsCountForSetup].OrderId, + ProductId: productIds[i % ProductIdsCountForSetup].ProductId, + Quantity: Random.Shared.Next(1, 10), + UnitPrice: (decimal)(Random.Shared.NextDouble() * 100 + 5) + ))]; + } + + private static List GetEFCoreTestOrderItems( + List orderIds, + List productIds) + { + return [.. Enumerable.Range(0, TotalRecordsForSetup).Select(i => new Queries.AddOrderItemsArgs( + OrderId: orderIds[i % OrderIdsCountForSetup].OrderId, + ProductId: productIds[i % ProductIdsCountForSetup].ProductId, + Quantity: Random.Shared.Next(1, 10), + UnitPrice: (decimal)(Random.Shared.NextDouble() * 100 + 5) + ))]; + } + + private static async Task CleanupWriteTableAsync(string connectionString) + { + using var connection = new SqliteConnection(connectionString); + await connection.OpenAsync(); + using var cmd = new SqliteCommand("DELETE FROM order_items", connection); + await cmd.ExecuteNonQueryAsync(); + } +} \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/Config.cs b/benchmark/BenchmarkRunner/Config.cs new file mode 100644 index 00000000..675e5070 --- /dev/null +++ b/benchmark/BenchmarkRunner/Config.cs @@ -0,0 +1,46 @@ +using dotenv.net; + +namespace BenchmarkRunner; + +public static partial class Config +{ + static Config() + { + var envFile = Path.Combine(AppContext.BaseDirectory, ".env"); + if (File.Exists(envFile)) + DotEnv.Load(options: new DotEnvOptions(envFilePaths: [envFile])); + } + + public static string GetPostgresConnectionString() + { + var connectionString = Environment.GetEnvironmentVariable("POSTGRES_BENCHMARK_CONNECTION_STRING"); + if (string.IsNullOrWhiteSpace(connectionString)) + throw new InvalidOperationException( + "POSTGRES_BENCHMARK_CONNECTION_STRING environment variable is not set. " + + "Please set it to your PostgreSQL connection string (e.g., " + + "Host=localhost;Port=5432;Database=sales;Username=postgres;Password=postgres)"); + return connectionString; + } + + public static string GetSqliteConnectionString() + { + var connectionString = Environment.GetEnvironmentVariable("SQLITE_BENCHMARK_CONNECTION_STRING"); + if (string.IsNullOrWhiteSpace(connectionString)) + throw new InvalidOperationException( + "SQLITE_BENCHMARK_CONNECTION_STRING environment variable is not set. " + + "Please set it to your SQLite connection string (e.g., " + + "Data Source=benchmark.db;Mode=ReadWriteCreate)"); + return connectionString; + } + + public static string GetMysqlConnectionString() + { + var connectionString = Environment.GetEnvironmentVariable("MYSQL_BENCHMARK_CONNECTION_STRING"); + if (string.IsNullOrWhiteSpace(connectionString)) + throw new InvalidOperationException( + "MYSQL_BENCHMARK_CONNECTION_STRING environment variable is not set. " + + "Please set it to your MySQL connection string (e.g., " + + "Server=localhost;Port=3306;Database=sales;User=root;Password=)"); + return connectionString; + } +} \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/Program.cs b/benchmark/BenchmarkRunner/Program.cs new file mode 100644 index 00000000..1fc21ee1 --- /dev/null +++ b/benchmark/BenchmarkRunner/Program.cs @@ -0,0 +1,78 @@ +using System.CommandLine; + +public class Program +{ + private static readonly HashSet _databases = ["mysql", "postgresql", "sqlite"]; + private static readonly HashSet _types = ["reads", "writes"]; + private static readonly MysqlRunner _mysqlRunner = new(); + private static readonly PostgresqlRunner _postgresqlRunner = new(); + private static readonly SqliteRunner _sqliteRunner = new(); + private static readonly Dictionary>> _benchmarkConfigs = new() + { + { "mysql", new() + { + { "reads", _mysqlRunner.RunReadsAsync }, + { "writes", _mysqlRunner.RunWritesAsync } + }}, + { "postgresql", new() + { + { "reads", _postgresqlRunner.RunReadsAsync }, + { "writes", _postgresqlRunner.RunWritesAsync } + }}, + { "sqlite", new() + { + { "reads", _sqliteRunner.RunReadsAsync }, + { "writes", _sqliteRunner.RunWritesAsync } + }} + }; + + public static async Task Main(string[] args) + { + var rootCommand = new RootCommand("Run benchmarks"); + + var databaseOption = GetDatabaseOption(); + rootCommand.AddOption(databaseOption); + + var typeOption = GetTypeOption(); + rootCommand.AddOption(typeOption); + + rootCommand.SetHandler( + async (database, type) => await _benchmarkConfigs[database][type](), + databaseOption, typeOption); + await rootCommand.InvokeAsync(args); + } + + private static Option GetDatabaseOption() + { + var option = new Option( + "--database", + "Database to benchmark (mysql, postgresql, or sqlite)") + { + IsRequired = true + }; + option.AddValidator(result => + { + var value = result.GetValueForOption(option); + if (value != null && !_databases.Contains(value)) + result.ErrorMessage = $"Invalid database: {value}. Must be one of: {string.Join(", ", _databases)}"; + }); + return option; + } + + private static Option GetTypeOption() + { + var option = new Option( + "--type", + $"Type of benchmark to run ({string.Join(", ", _types)})") + { + IsRequired = true + }; + option.AddValidator(result => + { + var value = result.GetValueForOption(option); + if (value != null && !_types.Contains(value)) + result.ErrorMessage = $"Invalid type: {value}. Must be one of: {string.Join(", ", _types)}"; + }); + return option; + } +} \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/Runners/BaseRunner.cs b/benchmark/BenchmarkRunner/Runners/BaseRunner.cs new file mode 100644 index 00000000..8a7a37c4 --- /dev/null +++ b/benchmark/BenchmarkRunner/Runners/BaseRunner.cs @@ -0,0 +1,6 @@ +public abstract class BaseRunner +{ + public virtual string GetOutputBasePath() => Path.Combine("benchmark", "BenchmarkDotNet.Artifacts"); + public abstract Task RunReadsAsync(); + public abstract Task RunWritesAsync(); +} \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/Runners/MysqlRunner.cs b/benchmark/BenchmarkRunner/Runners/MysqlRunner.cs new file mode 100644 index 00000000..d15382da --- /dev/null +++ b/benchmark/BenchmarkRunner/Runners/MysqlRunner.cs @@ -0,0 +1,31 @@ +using BenchmarkDotNet.Configs; +using BenchmarkRunner.Benchmarks; + +public sealed class MysqlRunner : BaseRunner +{ + public override string GetOutputBasePath() => Path.Combine(base.GetOutputBasePath(), "mysql"); + + public override async Task RunReadsAsync() + { + await MysqlReadBenchmark.GetSeedMethod()(); + var path = Path.Combine(GetOutputBasePath(), "reads"); + var summary = BenchmarkDotNet.Running.BenchmarkRunner.Run( + DefaultConfig.Instance.WithArtifactsPath(path) + ); + + if (summary.HasCriticalValidationErrors) + throw new InvalidProgramException("Mysql reads benchmark failed"); + } + + public override async Task RunWritesAsync() + { + await MysqlWriteBenchmark.GetSeedMethod()(); + var path = Path.Combine(GetOutputBasePath(), "writes"); + var summary = BenchmarkDotNet.Running.BenchmarkRunner.Run( + DefaultConfig.Instance.WithArtifactsPath(path) + ); + + if (summary.HasCriticalValidationErrors) + throw new InvalidProgramException("Mysql writes benchmark failed"); + } +} \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/Runners/PostgresqlRunner.cs b/benchmark/BenchmarkRunner/Runners/PostgresqlRunner.cs new file mode 100644 index 00000000..19ee79a4 --- /dev/null +++ b/benchmark/BenchmarkRunner/Runners/PostgresqlRunner.cs @@ -0,0 +1,31 @@ +using BenchmarkDotNet.Configs; +using BenchmarkRunner.Benchmarks; + +public sealed class PostgresqlRunner : BaseRunner +{ + public override string GetOutputBasePath() => Path.Combine(base.GetOutputBasePath(), "postgresql"); + + public override async Task RunReadsAsync() + { + await PostgresqlReadBenchmark.GetSeedMethod()(); + var path = Path.Combine(GetOutputBasePath(), "reads"); + var summary = BenchmarkDotNet.Running.BenchmarkRunner.Run( + DefaultConfig.Instance.WithArtifactsPath(path) + ); + + if (summary.HasCriticalValidationErrors) + throw new InvalidProgramException("Postgresql reads benchmark failed"); + } + + public override async Task RunWritesAsync() + { + await PostgresqlWriteBenchmark.GetSeedMethod()(); + var path = Path.Combine(GetOutputBasePath(), "writes"); + var summary = BenchmarkDotNet.Running.BenchmarkRunner.Run( + DefaultConfig.Instance.WithArtifactsPath(path) + ); + + if (summary.HasCriticalValidationErrors) + throw new InvalidProgramException("Postgresql writes benchmark failed"); + } +} \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/Runners/SqliteRunner.cs b/benchmark/BenchmarkRunner/Runners/SqliteRunner.cs new file mode 100644 index 00000000..be0fe892 --- /dev/null +++ b/benchmark/BenchmarkRunner/Runners/SqliteRunner.cs @@ -0,0 +1,31 @@ +using BenchmarkDotNet.Configs; +using BenchmarkRunner.Benchmarks; + +public sealed partial class SqliteRunner : BaseRunner +{ + public override string GetOutputBasePath() => Path.Combine(base.GetOutputBasePath(), "sqlite"); + + public override async Task RunReadsAsync() + { + await SqliteReadBenchmark.GetSeedMethod()(); + var path = Path.Combine(GetOutputBasePath(), "reads"); + var summary = BenchmarkDotNet.Running.BenchmarkRunner.Run( + DefaultConfig.Instance.WithArtifactsPath(path) + ); + + if (summary.HasCriticalValidationErrors) + throw new InvalidProgramException("Sqlite reads benchmark failed"); + } + + public override async Task RunWritesAsync() + { + await SqliteWriteBenchmark.GetSeedMethod()(); + var path = Path.Combine(GetOutputBasePath(), "writes"); + var summary = BenchmarkDotNet.Running.BenchmarkRunner.Run( + DefaultConfig.Instance.WithArtifactsPath(path) + ); + + if (summary.HasCriticalValidationErrors) + throw new InvalidProgramException("Sqlite writes benchmark failed"); + } +} \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/Seeders/MysqlSeeder.cs b/benchmark/BenchmarkRunner/Seeders/MysqlSeeder.cs new file mode 100644 index 00000000..3043f1b7 --- /dev/null +++ b/benchmark/BenchmarkRunner/Seeders/MysqlSeeder.cs @@ -0,0 +1,114 @@ +using MysqlSqlcImpl; + +namespace BenchmarkRunner.Utils; + +public class MysqlSeeder(string connectionString) +{ + private const int BatchSize = 10000; + private readonly QuerySql _sqlc = new(connectionString); + + public async Task SeedAsync(DatabaseSeedConfig config) + { + var customers = await SeedCustomersAsync(config.CustomerCount); + if (customers.Count > 0) + Console.WriteLine($"Seeded {customers.Count} customers"); + + var products = await SeedProductsAsync(config.ProductsPerCategory); + if (products.Count > 0) + Console.WriteLine($"Seeded {products.Count} products"); + + var orders = await SeedOrdersAsync(customers, config.OrdersPerCustomer); + if (orders.Count > 0) + Console.WriteLine($"Seeded {orders.Count} orders"); + + if (orders.Count > 0 && products.Count > 0 && config.ItemsPerOrder > 0) + { + await SeedOrderItemsAsync(orders, products, config.ItemsPerOrder); + Console.WriteLine($"Seeded order items"); + } + } + + private async Task> SeedCustomersAsync(int count) + { + var customers = new List(); + for (int i = 0; i < count; i++) + { + customers.Add(new QuerySql.AddCustomersArgs( + Name: $"Customer {i + 1}", + Email: $"customer{i + 1}@example.com", + Phone: $"+1-555-{1000 + i:D4}", + Address: $"{Random.Shared.Next(100, 9999)} Main St, City {i % 10}", + RegisteredAt: DateTime.UtcNow.AddDays(-Random.Shared.Next(0, 365)) + )); + } + + await Helpers.InsertInBatchesAsync(customers, BatchSize, _sqlc.AddCustomersAsync); + var customerIds = await _sqlc.GetCustomerIdsAsync(new QuerySql.GetCustomerIdsArgs(Limit: count)); + return [.. customerIds.Select(r => r.CustomerId)]; + } + + private async Task> SeedProductsAsync(int perCategory) + { + var categories = new[] { "Electronics", "Clothing", "Books", "Toys", "Home", "Sports", "Beauty" }; + var products = new List(); + + foreach (var category in categories) + { + for (int i = 0; i < perCategory; i++) + { + products.Add(new QuerySql.AddProductsArgs( + Name: $"{category} Product {i + 1}", + Category: category, + UnitPrice: (decimal)(Random.Shared.NextDouble() * 1000 + 10), + StockQuantity: Random.Shared.Next(0, 1000), + Description: $"Description for {category} Product {i + 1}" + )); + } + } + + await Helpers.InsertInBatchesAsync(products, BatchSize, _sqlc.AddProductsAsync); + var productIds = await _sqlc.GetProductIdsAsync(new QuerySql.GetProductIdsArgs(Limit: products.Count)); + return [.. productIds.Select(r => r.ProductId)]; + } + + private async Task> SeedOrdersAsync(List customerIds, int ordersPerCustomer) + { + var orderStates = new[] { "Pending", "Delivered", "Cancelled" }; + var orders = new List(); + + foreach (var customerId in customerIds) + { + for (int i = 0; i < ordersPerCustomer; i++) + { + orders.Add(new QuerySql.AddOrdersArgs( + CustomerId: customerId, + OrderState: orderStates[Random.Shared.Next(orderStates.Length)], + TotalAmount: (decimal)(Random.Shared.NextDouble() * 5000 + 10) + )); + } + } + + await Helpers.InsertInBatchesAsync(orders, BatchSize, _sqlc.AddOrdersAsync); + var orderIds = await _sqlc.GetOrderIdsAsync(new QuerySql.GetOrderIdsArgs(Limit: orders.Count)); + return [.. orderIds.Select(r => r.OrderId)]; + } + + private async Task SeedOrderItemsAsync(List orderIds, List productIds, int itemsPerOrder) + { + var orderItems = new List(); + foreach (var orderId in orderIds) + { + for (int i = 0; i < itemsPerOrder; i++) + { + orderItems.Add(new QuerySql.AddOrderItemsArgs( + OrderId: orderId, + ProductId: productIds[Random.Shared.Next(1, productIds.Count)], + Quantity: Random.Shared.Next(1, 10), + UnitPrice: (decimal)(Random.Shared.NextDouble() * 100 + 5) + )); + } + } + + await Helpers.InsertInBatchesAsync(orderItems, BatchSize, _sqlc.AddOrderItemsAsync); + } +} \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/Seeders/PostgresqlSeeder.cs b/benchmark/BenchmarkRunner/Seeders/PostgresqlSeeder.cs new file mode 100644 index 00000000..42b0ab26 --- /dev/null +++ b/benchmark/BenchmarkRunner/Seeders/PostgresqlSeeder.cs @@ -0,0 +1,117 @@ +using PostgresSqlcImpl; + +namespace BenchmarkRunner.Utils; + +public class PostgresqlSeeder(string connectionString) +{ + private const int BatchSize = 500; + private readonly QuerySql _sqlc = new(connectionString); + + public async Task SeedAsync(DatabaseSeedConfig config) + { + var customers = await SeedCustomersAsync(config.CustomerCount); + if (customers.Count > 0) + Console.WriteLine($"Seeded {customers.Count} customers"); + + var products = await SeedProductsAsync(config.ProductsPerCategory); + if (products.Count > 0) + Console.WriteLine($"Seeded {products.Count} products"); + + var orders = await SeedOrdersAsync(customers, config.OrdersPerCustomer); + if (orders.Count > 0) + Console.WriteLine($"Seeded {orders.Count} orders"); + + if (orders.Count > 0 && products.Count > 0 && config.ItemsPerOrder > 0) + { + await SeedOrderItemsAsync(orders, products, config.ItemsPerOrder); + Console.WriteLine($"Seeded order items"); + } + } + + private async Task> SeedCustomersAsync(int count) + { + var customers = new List(); + for (int i = 0; i < count; i++) + { + var registeredAt = DateTime.UtcNow.AddDays(-Random.Shared.Next(0, 365)); + customers.Add(new QuerySql.AddCustomersArgs( + Name: $"Customer {i + 1}", + Email: $"customer{i + 1}@example.com", + Phone: $"+1-555-{1000 + i:D4}", + Address: $"{Random.Shared.Next(100, 9999)} Main St, City {i % 10}", + RegisteredAt: registeredAt.Kind == DateTimeKind.Utc + ? DateTime.SpecifyKind(registeredAt, DateTimeKind.Unspecified) + : registeredAt + )); + } + + await Helpers.InsertInBatchesAsync(customers, BatchSize, _sqlc.AddCustomersAsync); + var customerIds = await _sqlc.GetCustomerIdsAsync(new QuerySql.GetCustomerIdsArgs(Limit: count)); + return [.. customerIds.Select(r => r.CustomerId)]; + } + + private async Task> SeedProductsAsync(int perCategory) + { + var categories = new[] { "Electronics", "Clothing", "Books", "Toys", "Home", "Sports", "Beauty" }; + var products = new List(); + + foreach (var category in categories) + { + for (int i = 0; i < perCategory; i++) + { + products.Add(new QuerySql.AddProductsArgs( + Name: $"{category} Product {i + 1}", + Category: category, + UnitPrice: (decimal)(Random.Shared.NextDouble() * 1000 + 10), + StockQuantity: Random.Shared.Next(0, 1000), + Description: $"Description for {category} Product {i + 1}" + )); + } + } + + await Helpers.InsertInBatchesAsync(products, BatchSize, _sqlc.AddProductsAsync); + var productIds = await _sqlc.GetProductIdsAsync(new QuerySql.GetProductIdsArgs(Limit: products.Count)); + return [.. productIds.Select(r => r.ProductId)]; + } + + private async Task> SeedOrdersAsync(List customerIds, int ordersPerCustomer) + { + var orderStates = new[] { "Pending", "Delivered", "Cancelled" }; + var orders = new List(); + + foreach (var customerId in customerIds) + { + for (int i = 0; i < ordersPerCustomer; i++) + { + orders.Add(new QuerySql.AddOrdersArgs( + CustomerId: customerId, + OrderState: orderStates[Random.Shared.Next(orderStates.Length)], + TotalAmount: (decimal)(Random.Shared.NextDouble() * 5000 + 10) + )); + } + } + + await Helpers.InsertInBatchesAsync(orders, BatchSize, _sqlc.AddOrdersAsync); + var orderIds = await _sqlc.GetOrderIdsAsync(new QuerySql.GetOrderIdsArgs(Limit: orders.Count)); + return [.. orderIds.Select(r => r.OrderId)]; + } + + private async Task SeedOrderItemsAsync(List orderIds, List productIds, int itemsPerOrder) + { + var orderItems = new List(); + foreach (var orderId in orderIds) + { + for (int i = 0; i < itemsPerOrder; i++) + { + orderItems.Add(new QuerySql.AddOrderItemsArgs( + OrderId: orderId, + ProductId: productIds[Random.Shared.Next(1, productIds.Count)], + Quantity: Random.Shared.Next(1, 10), + UnitPrice: (decimal)(Random.Shared.NextDouble() * 100 + 5) + )); + } + } + + await Helpers.InsertInBatchesAsync(orderItems, BatchSize, _sqlc.AddOrderItemsAsync); + } +} \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/Seeders/SeedConfig.cs b/benchmark/BenchmarkRunner/Seeders/SeedConfig.cs new file mode 100644 index 00000000..8085fbcb --- /dev/null +++ b/benchmark/BenchmarkRunner/Seeders/SeedConfig.cs @@ -0,0 +1,6 @@ +public readonly record struct DatabaseSeedConfig( + int CustomerCount, + int ProductsPerCategory, + int OrdersPerCustomer, + int ItemsPerOrder +); \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/Seeders/SqliteSeeder.cs b/benchmark/BenchmarkRunner/Seeders/SqliteSeeder.cs new file mode 100644 index 00000000..d5a375fe --- /dev/null +++ b/benchmark/BenchmarkRunner/Seeders/SqliteSeeder.cs @@ -0,0 +1,115 @@ +using SqliteSqlcImpl; + +namespace BenchmarkRunner.Utils; + +public class SqliteSeeder(string connectionString) +{ + private const int BatchSize = 100; + private readonly QuerySql _sqlc = new(connectionString); + + public async Task SeedAsync(DatabaseSeedConfig config) + { + var customers = await SeedCustomersAsync(config.CustomerCount); + if (customers.Count > 0) + Console.WriteLine($"Seeded {customers.Count} customers"); + + var products = await SeedProductsAsync(config.ProductsPerCategory); + if (products.Count > 0) + Console.WriteLine($"Seeded {products.Count} products"); + + var orders = await SeedOrdersAsync(customers, config.OrdersPerCustomer); + if (orders.Count > 0) + Console.WriteLine($"Seeded {orders.Count} orders"); + + if (orders.Count > 0 && products.Count > 0 && config.ItemsPerOrder > 0) + { + await SeedOrderItemsAsync(orders, products, config.ItemsPerOrder); + Console.WriteLine($"Seeded order items"); + } + } + + private async Task> SeedCustomersAsync(int count) + { + var customers = new List(); + for (int i = 0; i < count; i++) + { + var registeredAt = DateTime.UtcNow.AddDays(-Random.Shared.Next(0, 365)); + customers.Add(new QuerySql.AddCustomersArgs( + Name: $"Customer {i + 1}", + Email: $"customer{i + 1}@example.com", + Phone: $"+1-555-{1000 + i:D4}", + Address: $"{Random.Shared.Next(100, 9999)} Main St, City {i % 10}", + RegisteredAt: registeredAt.ToString("yyyy-MM-dd HH:mm:ss.FFFFFFF") + )); + } + + await Helpers.InsertInBatchesAsync(customers, BatchSize, _sqlc.AddCustomersAsync); + var customerIds = await _sqlc.GetCustomerIdsAsync(new QuerySql.GetCustomerIdsArgs(Limit: count)); + return [.. customerIds.Select(r => r.CustomerId)]; + } + + private async Task> SeedProductsAsync(int perCategory) + { + var categories = new[] { "Electronics", "Clothing", "Books", "Toys", "Home", "Sports", "Beauty" }; + var products = new List(); + + foreach (var category in categories) + { + for (int i = 0; i < perCategory; i++) + { + products.Add(new QuerySql.AddProductsArgs( + Name: $"{category} Product {i + 1}", + Category: category, + UnitPrice: (decimal)(Random.Shared.NextDouble() * 1000 + 10), + StockQuantity: Random.Shared.Next(0, 1000), + Description: $"Description for {category} Product {i + 1}" + )); + } + } + + await Helpers.InsertInBatchesAsync(products, BatchSize, _sqlc.AddProductsAsync); + var productIds = await _sqlc.GetProductIdsAsync(new QuerySql.GetProductIdsArgs(Limit: products.Count)); + return [.. productIds.Select(r => r.ProductId)]; + } + + private async Task> SeedOrdersAsync(List customerIds, int ordersPerCustomer) + { + var orderStates = new[] { "Pending", "Delivered", "Cancelled" }; + var orders = new List(); + + foreach (var customerId in customerIds) + { + for (int i = 0; i < ordersPerCustomer; i++) + { + orders.Add(new QuerySql.AddOrdersArgs( + CustomerId: customerId, + OrderState: orderStates[Random.Shared.Next(orderStates.Length)], + TotalAmount: (decimal)(Random.Shared.NextDouble() * 5000 + 10) + )); + } + } + + await Helpers.InsertInBatchesAsync(orders, BatchSize, _sqlc.AddOrdersAsync); + var orderIds = await _sqlc.GetOrderIdsAsync(new QuerySql.GetOrderIdsArgs(Limit: orders.Count)); + return orderIds.Select(r => r.OrderId).ToList(); + } + + private async Task SeedOrderItemsAsync(List orderIds, List productIds, int itemsPerOrder) + { + var orderItems = new List(); + foreach (var orderId in orderIds) + { + for (int i = 0; i < itemsPerOrder; i++) + { + orderItems.Add(new QuerySql.AddOrderItemsArgs( + OrderId: orderId, + ProductId: productIds[Random.Shared.Next(1, productIds.Count)], + Quantity: Random.Shared.Next(1, 10), + UnitPrice: (decimal)(Random.Shared.NextDouble() * 100 + 5) + )); + } + } + + await Helpers.InsertInBatchesAsync(orderItems, BatchSize, _sqlc.AddOrderItemsAsync); + } +} \ No newline at end of file diff --git a/benchmark/BenchmarkRunner/Utils.cs b/benchmark/BenchmarkRunner/Utils.cs new file mode 100644 index 00000000..e1ed71b8 --- /dev/null +++ b/benchmark/BenchmarkRunner/Utils.cs @@ -0,0 +1,41 @@ +namespace BenchmarkRunner.Utils; + +public static class Helpers +{ + /* + InitializeOnceAsync is a helper method to ensure that a task is only executed once. + _initLock is a semaphore to ensure that only one task is executed at a time. + isInitialized is a flag to check if the task has been executed. + */ + public static bool _isInitialized = false; + public static SemaphoreSlim _initLock = new(1, 1); + public static async Task InitializeOnceAsync(Func task) + { + if (_isInitialized) return; + await _initLock.WaitAsync(); + try + { + if (_isInitialized) return; + await task.Invoke(); + _isInitialized = true; + } + finally + { + _initLock.Release(); + } + } + + public static async Task InsertInBatchesAsync(List items, int batchSize, Func, Task> insertBatch) + { + var batches = items.Chunk(batchSize); + foreach (var batch in batches) + await insertBatch([.. batch]); + } + + public static void InvokeGarbageCollection() + { + GC.Collect(); + GC.WaitForPendingFinalizers(); + GC.Collect(); + } +} \ No newline at end of file diff --git a/benchmark/MysqlEFCoreImpl/Models.cs b/benchmark/MysqlEFCoreImpl/Models.cs new file mode 100644 index 00000000..16cc9c8d --- /dev/null +++ b/benchmark/MysqlEFCoreImpl/Models.cs @@ -0,0 +1,134 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace MysqlEFCoreImpl; + +[Table("customers")] +public class Customer +{ + [Key] + [Column("customer_id")] + public int CustomerId { get; set; } + + [Required] + [Column("name")] + [MaxLength(100)] + public string Name { get; set; } = string.Empty; + + [Required] + [Column("email")] + [MaxLength(255)] + public string Email { get; set; } = string.Empty; + + [Required] + [Column("phone")] + [MaxLength(50)] + public string Phone { get; set; } = string.Empty; + + [Column("address")] + [MaxLength(255)] + public string? Address { get; set; } + + [Required] + [Column("registered_at")] + public DateTime RegisteredAt { get; set; } + + public ICollection Orders { get; set; } = new List(); +} + +[Table("products")] +public class Product +{ + [Key] + [Column("product_id")] + public int ProductId { get; set; } + + [Required] + [Column("name")] + [MaxLength(200)] + public string Name { get; set; } = string.Empty; + + [Required] + [Column("category")] + [MaxLength(100)] + public string Category { get; set; } = string.Empty; + + [Required] + [Column("unit_price", TypeName = "decimal(10,2)")] + public decimal UnitPrice { get; set; } + + [Required] + [Column("stock_quantity")] + public int StockQuantity { get; set; } + + [Column("description")] + public string? Description { get; set; } + + [Required] + [Column("added_at")] + public DateTime AddedAt { get; set; } + + public ICollection OrderItems { get; set; } = new List(); +} + +[Table("orders")] +public class Order +{ + [Key] + [Column("order_id")] + public long OrderId { get; set; } + + [Required] + [Column("customer_id")] + public int CustomerId { get; set; } + + [Required] + [Column("ordered_at")] + public DateTime OrderedAt { get; set; } + + [Required] + [Column("order_state")] + [MaxLength(10)] + public string OrderState { get; set; } = string.Empty; + + [Required] + [Column("total_amount", TypeName = "decimal(10,2)")] + public decimal TotalAmount { get; set; } + + [ForeignKey(nameof(CustomerId))] + public Customer Customer { get; set; } = null!; + + public ICollection OrderItems { get; set; } = new List(); +} + +[Table("order_items")] +public class OrderItem +{ + [Key] + [Column("order_item_id")] + public long OrderItemId { get; set; } + + [Required] + [Column("order_id")] + public long OrderId { get; set; } + + [Required] + [Column("product_id")] + public int ProductId { get; set; } + + [Required] + [Column("quantity")] + public int Quantity { get; set; } + + [Required] + [Column("unit_price", TypeName = "decimal(10,2)")] + public decimal UnitPrice { get; set; } + + [ForeignKey(nameof(OrderId))] + public Order Order { get; set; } = null!; + + [ForeignKey(nameof(ProductId))] + public Product Product { get; set; } = null!; +} \ No newline at end of file diff --git a/benchmark/MysqlEFCoreImpl/MysqlEFCoreImpl.csproj b/benchmark/MysqlEFCoreImpl/MysqlEFCoreImpl.csproj new file mode 100644 index 00000000..4d338e1b --- /dev/null +++ b/benchmark/MysqlEFCoreImpl/MysqlEFCoreImpl.csproj @@ -0,0 +1,15 @@ + + + + net8.0 + enable + enable + + + + + + + + + diff --git a/benchmark/MysqlEFCoreImpl/Queries.cs b/benchmark/MysqlEFCoreImpl/Queries.cs new file mode 100644 index 00000000..56581cb7 --- /dev/null +++ b/benchmark/MysqlEFCoreImpl/Queries.cs @@ -0,0 +1,138 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace MysqlEFCoreImpl; + +public class Queries +{ + private readonly SalesDbContext _dbContext; + private readonly bool _useTracking; + + public Queries(SalesDbContext dbContext, bool useTracking = false) + { + _dbContext = dbContext; + _useTracking = useTracking; + } + + public DbContext DbContext => _dbContext; + + // Result type for GetCustomerOrders matching SqlC output + public record GetCustomerOrdersRow( + long OrderId, + DateTime OrderedAt, + string OrderState, + decimal TotalAmount, + long OrderItemId, + int Quantity, + decimal UnitPrice, + int ProductId, + string ProductName, + string ProductCategory + ); + + public record GetCustomerOrdersArgs(int CustomerId, int Offset, int Limit); + + /// + /// Get customer orders with all order items and product details, ordered by date descending with pagination + /// + public async Task> GetCustomerOrders(GetCustomerOrdersArgs args) + { + var ordersQuery = _dbContext.Orders.AsQueryable(); + var orderItemsQuery = _dbContext.OrderItems.AsQueryable(); + var productsQuery = _dbContext.Products.AsQueryable(); + + if (!_useTracking) + { + ordersQuery = ordersQuery.AsNoTracking(); + orderItemsQuery = orderItemsQuery.AsNoTracking(); + productsQuery = productsQuery.AsNoTracking(); + } + + var results = await (from o in ordersQuery + join i in orderItemsQuery on o.OrderId equals i.OrderId + join p in productsQuery on i.ProductId equals p.ProductId + where o.CustomerId == args.CustomerId + orderby o.OrderedAt descending + select new GetCustomerOrdersRow( + o.OrderId, + o.OrderedAt, + o.OrderState, + o.TotalAmount, + i.OrderItemId, + i.Quantity, + i.UnitPrice, + p.ProductId, + p.Name, + p.Category + )) + .Skip(args.Offset) + .Take(args.Limit) + .ToListAsync(); + return results; + } + + public record AddProductsArgs(string Name, string Category, decimal UnitPrice, int StockQuantity, string? Description); + + /// + /// Bulk insert products + /// + public async Task AddProducts(List args) + { + var products = args.Select(a => new Product + { + Name = a.Name, + Category = a.Category, + UnitPrice = a.UnitPrice, + StockQuantity = a.StockQuantity, + Description = a.Description, + AddedAt = DateTime.UtcNow + }).ToList(); + + await _dbContext.Products.AddRangeAsync(products); + await _dbContext.SaveChangesAsync(); + _dbContext.ChangeTracker.Clear(); + } + + public record AddOrdersArgs(int CustomerId, string OrderState, decimal TotalAmount); + + /// + /// Bulk insert orders + /// + public async Task AddOrders(List args) + { + var orders = args.Select(a => new Order + { + CustomerId = a.CustomerId, + OrderState = a.OrderState, + TotalAmount = a.TotalAmount, + OrderedAt = DateTime.UtcNow + }).ToList(); + + await _dbContext.Orders.AddRangeAsync(orders); + await _dbContext.SaveChangesAsync(); + _dbContext.ChangeTracker.Clear(); + } + + public record AddOrderItemsArgs(long OrderId, int ProductId, int Quantity, decimal UnitPrice); + + /// + /// Bulk insert order items + /// + public async Task AddOrderItems(List args) + { + var orderItems = args.Select(a => new OrderItem + { + OrderId = a.OrderId, + ProductId = a.ProductId, + Quantity = a.Quantity, + UnitPrice = a.UnitPrice + }).ToList(); + + await _dbContext.OrderItems.AddRangeAsync(orderItems); + await _dbContext.SaveChangesAsync(); + _dbContext.ChangeTracker.Clear(); + } +} \ No newline at end of file diff --git a/benchmark/MysqlEFCoreImpl/SalesDbContext.cs b/benchmark/MysqlEFCoreImpl/SalesDbContext.cs new file mode 100644 index 00000000..e8566880 --- /dev/null +++ b/benchmark/MysqlEFCoreImpl/SalesDbContext.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore; +using MysqlEFCoreImpl; + +namespace MysqlEFCoreImpl; + +public class SalesDbContext(string connectionString) : DbContext +{ + public DbSet Customers { get; set; } = null!; + public DbSet Products { get; set; } = null!; + public DbSet Orders { get; set; } = null!; + public DbSet OrderItems { get; set; } = null!; + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + if (!optionsBuilder.IsConfigured) + optionsBuilder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)); + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + } +} \ No newline at end of file diff --git a/benchmark/MysqlSqlcImpl/Models.cs b/benchmark/MysqlSqlcImpl/Models.cs new file mode 100644 index 00000000..142f5fa7 --- /dev/null +++ b/benchmark/MysqlSqlcImpl/Models.cs @@ -0,0 +1,10 @@ +// auto-generated by sqlc - do not edit +using System; +using System.Collections.Generic; +using System.Linq; + +namespace MysqlSqlcImpl; +public readonly record struct SalesCustomer(int CustomerId, string Name, string Email, string Phone, string? Address, DateTime RegisteredAt); +public readonly record struct SalesProduct(int ProductId, string Name, string Category, decimal UnitPrice, int StockQuantity, string? Description, DateTime AddedAt); +public readonly record struct SalesOrder(long OrderId, int CustomerId, DateTime OrderedAt, string OrderState, decimal TotalAmount); +public readonly record struct SalesOrderItem(long OrderItemId, long OrderId, int ProductId, int Quantity, decimal UnitPrice); \ No newline at end of file diff --git a/benchmark/MysqlSqlcImpl/MysqlSqlcImpl.csproj b/benchmark/MysqlSqlcImpl/MysqlSqlcImpl.csproj new file mode 100644 index 00000000..59c24a3e --- /dev/null +++ b/benchmark/MysqlSqlcImpl/MysqlSqlcImpl.csproj @@ -0,0 +1,21 @@ + + + + + + net8.0 + MysqlSqlcImpl + Library + enable + False + + + + + + + + + \ No newline at end of file diff --git a/benchmark/MysqlSqlcImpl/QuerySql.cs b/benchmark/MysqlSqlcImpl/QuerySql.cs new file mode 100644 index 00000000..5ef6e0c9 --- /dev/null +++ b/benchmark/MysqlSqlcImpl/QuerySql.cs @@ -0,0 +1,558 @@ +// auto-generated by sqlc - do not edit +// ReSharper disable UseObjectOrCollectionInitializer +// ReSharper disable UseAwaitUsing +// ReSharper disable ConvertToUsingDeclaration +// ReSharper disable NotAccessedPositionalProperty.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +using CsvHelper; +using CsvHelper.Configuration; +using CsvHelper.TypeConversion; +using MySqlConnector; +using System; +using System.Collections.Generic; +using System.Data; +using System.Globalization; +using System.IO; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace MysqlSqlcImpl; +public class QuerySql : IDisposable +{ + public QuerySql() + { + } + + public QuerySql(string connectionString) : this() + { + this.ConnectionString = connectionString; + _dataSource = new Lazy(() => + { + var builder = new MySqlConnectionStringBuilder(connectionString!); + builder.ConnectionReset = true; + // Pre-warm connection pool with minimum connections + if (builder.MinimumPoolSize == 0) + builder.MinimumPoolSize = 1; + return new MySqlDataSourceBuilder(builder.ConnectionString).Build(); + }, LazyThreadSafetyMode.ExecutionAndPublication); + } + + private QuerySql(MySqlTransaction transaction) : this() + { + this.Transaction = transaction; + } + + public static QuerySql WithTransaction(MySqlTransaction transaction) + { + return new QuerySql(transaction); + } + + private MySqlTransaction? Transaction { get; } + private string? ConnectionString { get; } + + private readonly Lazy? _dataSource; + private MySqlDataSource GetDataSource() + { + if (_dataSource == null) + throw new InvalidOperationException("ConnectionString is required when not using a transaction"); + return _dataSource.Value; + } + + public void Dispose() + { + GC.SuppressFinalize(this); + if (_dataSource?.IsValueCreated == true) + _dataSource.Value.Dispose(); + } + + private const string GetCustomerOrdersSql = @"SELECT + o.order_id, ordered_at, order_state, total_amount, order_item_id, i.quantity, i.unit_price, + p.product_id, p.name as product_name, p.category as product_category + FROM sales.orders o + JOIN sales.order_items i + USING (order_id) + JOIN sales.products p + USING (product_id) + WHERE o.customer_id = @customer_id + ORDER BY o.ordered_at DESC + LIMIT @limit OFFSET @offset"; + public readonly record struct GetCustomerOrdersRow(long OrderId, DateTime OrderedAt, string OrderState, decimal TotalAmount, long OrderItemId, int Quantity, decimal UnitPrice, int ProductId, string ProductName, string ProductCategory); + public readonly record struct GetCustomerOrdersArgs(int CustomerId, int Limit, int Offset); + public async Task> GetCustomerOrdersAsync(GetCustomerOrdersArgs args) + { + if (this.Transaction == null) + { + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + using (var command = connection.CreateCommand()) + { + command.CommandText = GetCustomerOrdersSql; + command.Parameters.AddWithValue("@customer_id", args.CustomerId); + command.Parameters.AddWithValue("@limit", args.Limit); + command.Parameters.AddWithValue("@offset", args.Offset); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetCustomerOrdersRow { OrderId = reader.GetInt64(0), OrderedAt = reader.GetDateTime(1), OrderState = reader.GetString(2), TotalAmount = reader.GetDecimal(3), OrderItemId = reader.GetInt64(4), Quantity = reader.GetInt32(5), UnitPrice = reader.GetDecimal(6), ProductId = reader.GetInt32(7), ProductName = reader.GetString(8), ProductCategory = reader.GetString(9) }); + return result; + } + } + } + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetCustomerOrdersSql; + command.Transaction = this.Transaction; + command.Parameters.AddWithValue("@customer_id", args.CustomerId); + command.Parameters.AddWithValue("@limit", args.Limit); + command.Parameters.AddWithValue("@offset", args.Offset); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetCustomerOrdersRow { OrderId = reader.GetInt64(0), OrderedAt = reader.GetDateTime(1), OrderState = reader.GetString(2), TotalAmount = reader.GetDecimal(3), OrderItemId = reader.GetInt64(4), Quantity = reader.GetInt32(5), UnitPrice = reader.GetDecimal(6), ProductId = reader.GetInt32(7), ProductName = reader.GetString(8), ProductCategory = reader.GetString(9) }); + return result; + } + } + } + + public readonly record struct AddCustomersArgs(string Name, string Email, string Phone, string? Address, DateTime RegisteredAt); + public async Task AddCustomersAsync(List args) + { + const string supportedDateTimeFormat = "yyyy-MM-dd H:mm:ss"; + var config = new CsvConfiguration(CultureInfo.CurrentCulture) + { + Delimiter = ",", + NewLine = "\n" + }; + var nullConverterFn = new Utils.NullToStringCsvConverter(); + using (var writer = new StreamWriter("input.csv", false, new UTF8Encoding(false))) + using (var csvWriter = new CsvWriter(writer, config)) + { + var options = new TypeConverterOptions + { + Formats = new[] + { + supportedDateTimeFormat + } + }; + csvWriter.Context.TypeConverterOptionsCache.AddOptions(options); + csvWriter.Context.TypeConverterOptionsCache.AddOptions(options); + csvWriter.Context.TypeConverterCache.AddConverter(nullConverterFn); + csvWriter.Context.TypeConverterCache.AddConverter(nullConverterFn); + await csvWriter.WriteRecordsAsync(args); + } + + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + var loader = new MySqlBulkLoader(connection) + { + Local = true, + TableName = "sales.customers", + FileName = "input.csv", + FieldTerminator = ",", + FieldQuotationCharacter = '"', + FieldQuotationOptional = true, + NumberOfLinesToSkip = 1, + LineTerminator = "\n" + }; + loader.Columns.AddRange(new List { "name", "email", "phone", "address", "registered_at" }); + await loader.LoadAsync(); + } + } + + public readonly record struct AddProductsArgs(string Name, string Category, decimal UnitPrice, int StockQuantity, string? Description); + public async Task AddProductsAsync(List args) + { + const string supportedDateTimeFormat = "yyyy-MM-dd H:mm:ss"; + var config = new CsvConfiguration(CultureInfo.CurrentCulture) + { + Delimiter = ",", + NewLine = "\n" + }; + var nullConverterFn = new Utils.NullToStringCsvConverter(); + using (var writer = new StreamWriter("input.csv", false, new UTF8Encoding(false))) + using (var csvWriter = new CsvWriter(writer, config)) + { + var options = new TypeConverterOptions + { + Formats = new[] + { + supportedDateTimeFormat + } + }; + csvWriter.Context.TypeConverterOptionsCache.AddOptions(options); + csvWriter.Context.TypeConverterOptionsCache.AddOptions(options); + csvWriter.Context.TypeConverterCache.AddConverter(nullConverterFn); + csvWriter.Context.TypeConverterCache.AddConverter(nullConverterFn); + csvWriter.Context.TypeConverterCache.AddConverter(nullConverterFn); + await csvWriter.WriteRecordsAsync(args); + } + + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + var loader = new MySqlBulkLoader(connection) + { + Local = true, + TableName = "sales.products", + FileName = "input.csv", + FieldTerminator = ",", + FieldQuotationCharacter = '"', + FieldQuotationOptional = true, + NumberOfLinesToSkip = 1, + LineTerminator = "\n" + }; + loader.Columns.AddRange(new List { "name", "category", "unit_price", "stock_quantity", "description" }); + await loader.LoadAsync(); + } + } + + public readonly record struct AddOrdersArgs(int CustomerId, string OrderState, decimal TotalAmount); + public async Task AddOrdersAsync(List args) + { + const string supportedDateTimeFormat = "yyyy-MM-dd H:mm:ss"; + var config = new CsvConfiguration(CultureInfo.CurrentCulture) + { + Delimiter = ",", + NewLine = "\n" + }; + var nullConverterFn = new Utils.NullToStringCsvConverter(); + using (var writer = new StreamWriter("input.csv", false, new UTF8Encoding(false))) + using (var csvWriter = new CsvWriter(writer, config)) + { + var options = new TypeConverterOptions + { + Formats = new[] + { + supportedDateTimeFormat + } + }; + csvWriter.Context.TypeConverterOptionsCache.AddOptions(options); + csvWriter.Context.TypeConverterOptionsCache.AddOptions(options); + csvWriter.Context.TypeConverterCache.AddConverter(nullConverterFn); + csvWriter.Context.TypeConverterCache.AddConverter(nullConverterFn); + csvWriter.Context.TypeConverterCache.AddConverter(nullConverterFn); + await csvWriter.WriteRecordsAsync(args); + } + + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + var loader = new MySqlBulkLoader(connection) + { + Local = true, + TableName = "sales.orders", + FileName = "input.csv", + FieldTerminator = ",", + FieldQuotationCharacter = '"', + FieldQuotationOptional = true, + NumberOfLinesToSkip = 1, + LineTerminator = "\n" + }; + loader.Columns.AddRange(new List { "customer_id", "order_state", "total_amount" }); + await loader.LoadAsync(); + } + } + + public readonly record struct AddOrderItemsArgs(long OrderId, int ProductId, int Quantity, decimal UnitPrice); + public async Task AddOrderItemsAsync(List args) + { + const string supportedDateTimeFormat = "yyyy-MM-dd H:mm:ss"; + var config = new CsvConfiguration(CultureInfo.CurrentCulture) + { + Delimiter = ",", + NewLine = "\n" + }; + var nullConverterFn = new Utils.NullToStringCsvConverter(); + using (var writer = new StreamWriter("input.csv", false, new UTF8Encoding(false))) + using (var csvWriter = new CsvWriter(writer, config)) + { + var options = new TypeConverterOptions + { + Formats = new[] + { + supportedDateTimeFormat + } + }; + csvWriter.Context.TypeConverterOptionsCache.AddOptions(options); + csvWriter.Context.TypeConverterOptionsCache.AddOptions(options); + csvWriter.Context.TypeConverterCache.AddConverter(nullConverterFn); + csvWriter.Context.TypeConverterCache.AddConverter(nullConverterFn); + csvWriter.Context.TypeConverterCache.AddConverter(nullConverterFn); + await csvWriter.WriteRecordsAsync(args); + } + + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + var loader = new MySqlBulkLoader(connection) + { + Local = true, + TableName = "sales.order_items", + FileName = "input.csv", + FieldTerminator = ",", + FieldQuotationCharacter = '"', + FieldQuotationOptional = true, + NumberOfLinesToSkip = 1, + LineTerminator = "\n" + }; + loader.Columns.AddRange(new List { "order_id", "product_id", "quantity", "unit_price" }); + await loader.LoadAsync(); + } + } + + private const string GetCustomerIdsSql = "SELECT customer_id FROM sales.customers ORDER BY customer_id LIMIT @limit"; + public readonly record struct GetCustomerIdsRow(int CustomerId); + public readonly record struct GetCustomerIdsArgs(int Limit); + public async Task> GetCustomerIdsAsync(GetCustomerIdsArgs args) + { + if (this.Transaction == null) + { + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + using (var command = connection.CreateCommand()) + { + command.CommandText = GetCustomerIdsSql; + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetCustomerIdsRow { CustomerId = reader.GetInt32(0) }); + return result; + } + } + } + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetCustomerIdsSql; + command.Transaction = this.Transaction; + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetCustomerIdsRow { CustomerId = reader.GetInt32(0) }); + return result; + } + } + } + + private const string GetProductIdsSql = "SELECT product_id FROM sales.products ORDER BY product_id LIMIT @limit"; + public readonly record struct GetProductIdsRow(int ProductId); + public readonly record struct GetProductIdsArgs(int Limit); + public async Task> GetProductIdsAsync(GetProductIdsArgs args) + { + if (this.Transaction == null) + { + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + using (var command = connection.CreateCommand()) + { + command.CommandText = GetProductIdsSql; + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetProductIdsRow { ProductId = reader.GetInt32(0) }); + return result; + } + } + } + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetProductIdsSql; + command.Transaction = this.Transaction; + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetProductIdsRow { ProductId = reader.GetInt32(0) }); + return result; + } + } + } + + private const string GetOrderIdsSql = "SELECT order_id FROM sales.orders ORDER BY order_id LIMIT @limit"; + public readonly record struct GetOrderIdsRow(long OrderId); + public readonly record struct GetOrderIdsArgs(int Limit); + public async Task> GetOrderIdsAsync(GetOrderIdsArgs args) + { + if (this.Transaction == null) + { + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + using (var command = connection.CreateCommand()) + { + command.CommandText = GetOrderIdsSql; + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetOrderIdsRow { OrderId = reader.GetInt64(0) }); + return result; + } + } + } + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetOrderIdsSql; + command.Transaction = this.Transaction; + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetOrderIdsRow { OrderId = reader.GetInt64(0) }); + return result; + } + } + } + + private const string GetOrderItemsCountSql = "SELECT COUNT(*) AS cnt FROM sales.order_items"; + public readonly record struct GetOrderItemsCountRow(long Cnt); + public async Task GetOrderItemsCountAsync() + { + if (this.Transaction == null) + { + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + using (var command = connection.CreateCommand()) + { + command.CommandText = GetOrderItemsCountSql; + using (var reader = await command.ExecuteReaderAsync()) + { + if (await reader.ReadAsync()) + { + return new GetOrderItemsCountRow + { + Cnt = reader.GetInt64(0) + }; + } + } + } + }; + return null; + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetOrderItemsCountSql; + command.Transaction = this.Transaction; + using (var reader = await command.ExecuteReaderAsync()) + { + if (await reader.ReadAsync()) + { + return new GetOrderItemsCountRow + { + Cnt = reader.GetInt64(0) + }; + } + } + } + + return null; + } + + private const string GetOrderAmountsSql = "SELECT order_id, total_amount FROM sales.orders WHERE order_id IN (/*SLICE:order_ids*/@order_id)"; + public readonly record struct GetOrderAmountsRow(long OrderId, decimal TotalAmount); + public readonly record struct GetOrderAmountsArgs(long OrderId); + public async Task> GetOrderAmountsAsync(GetOrderAmountsArgs args) + { + if (this.Transaction == null) + { + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + using (var command = connection.CreateCommand()) + { + command.CommandText = GetOrderAmountsSql; + command.Parameters.AddWithValue("@order_id", args.OrderId); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetOrderAmountsRow { OrderId = reader.GetInt64(0), TotalAmount = reader.GetDecimal(1) }); + return result; + } + } + } + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetOrderAmountsSql; + command.Transaction = this.Transaction; + command.Parameters.AddWithValue("@order_id", args.OrderId); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetOrderAmountsRow { OrderId = reader.GetInt64(0), TotalAmount = reader.GetDecimal(1) }); + return result; + } + } + } + + private const string GetProductPricesSql = "SELECT product_id, unit_price FROM sales.products WHERE product_id IN (/*SLICE:product_ids*/@product_id)"; + public readonly record struct GetProductPricesRow(int ProductId, decimal UnitPrice); + public readonly record struct GetProductPricesArgs(int ProductId); + public async Task> GetProductPricesAsync(GetProductPricesArgs args) + { + if (this.Transaction == null) + { + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + using (var command = connection.CreateCommand()) + { + command.CommandText = GetProductPricesSql; + command.Parameters.AddWithValue("@product_id", args.ProductId); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetProductPricesRow { ProductId = reader.GetInt32(0), UnitPrice = reader.GetDecimal(1) }); + return result; + } + } + } + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetProductPricesSql; + command.Transaction = this.Transaction; + command.Parameters.AddWithValue("@product_id", args.ProductId); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetProductPricesRow { ProductId = reader.GetInt32(0), UnitPrice = reader.GetDecimal(1) }); + return result; + } + } + } +} \ No newline at end of file diff --git a/benchmark/MysqlSqlcImpl/Utils.cs b/benchmark/MysqlSqlcImpl/Utils.cs new file mode 100644 index 00000000..9d4a0f49 --- /dev/null +++ b/benchmark/MysqlSqlcImpl/Utils.cs @@ -0,0 +1,18 @@ +// auto-generated by sqlc - do not edit +using CsvHelper; +using CsvHelper.Configuration; +using CsvHelper.TypeConversion; +using System.Collections.Generic; +using System.Linq; + +namespace MysqlSqlcImpl; +public static class Utils +{ + public class NullToStringCsvConverter : DefaultTypeConverter + { + public override string? ConvertToString(object? value, IWriterRow row, MemberMapData memberMapData) + { + return value == null ? @"\N" : base.ConvertToString(value, row, memberMapData); + } + } +} \ No newline at end of file diff --git a/benchmark/MysqlSqlcImpl/request.json b/benchmark/MysqlSqlcImpl/request.json new file mode 100644 index 00000000..57ee3b67 --- /dev/null +++ b/benchmark/MysqlSqlcImpl/request.json @@ -0,0 +1,1062 @@ +{ + "settings": { + "version": "2", + "engine": "mysql", + "schema": [ + "examples/config/mysql/benchmark/schema.sql" + ], + "queries": [ + "examples/config/mysql/benchmark/query.sql" + ], + "codegen": { + "out": "benchmark/MysqlSqlcImpl", + "plugin": "csharp", + "options": "eyJkZWJ1Z1JlcXVlc3QiOnRydWUsIm5hbWVzcGFjZU5hbWUiOiJNeXNxbFNxbGNJbXBsIn0=", + "process": { + "cmd": "./dist/LocalRunner" + } + } + }, + "catalog": { + "defaultSchema": "public", + "schemas": [ + { + "name": "public" + }, + { + "name": "sales", + "tables": [ + { + "rel": { + "schema": "sales", + "name": "customers" + }, + "columns": [ + { + "name": "customer_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "int" + } + }, + { + "name": "name", + "notNull": true, + "length": 100, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "varchar" + } + }, + { + "name": "email", + "notNull": true, + "length": 255, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "varchar" + } + }, + { + "name": "phone", + "notNull": true, + "length": 50, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "varchar" + } + }, + { + "name": "address", + "length": 255, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "varchar" + } + }, + { + "name": "registered_at", + "notNull": true, + "length": 19, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "datetime" + } + } + ] + }, + { + "rel": { + "schema": "sales", + "name": "products" + }, + "columns": [ + { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "int" + } + }, + { + "name": "name", + "notNull": true, + "length": 200, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "varchar" + } + }, + { + "name": "category", + "notNull": true, + "length": 100, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "varchar" + } + }, + { + "name": "unit_price", + "notNull": true, + "length": 10, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "decimal" + } + }, + { + "name": "stock_quantity", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "int" + } + }, + { + "name": "description", + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "text" + } + }, + { + "name": "added_at", + "notNull": true, + "length": 19, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "datetime" + } + } + ] + }, + { + "rel": { + "schema": "sales", + "name": "orders" + }, + "columns": [ + { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "bigint" + } + }, + { + "name": "customer_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "int" + } + }, + { + "name": "ordered_at", + "notNull": true, + "length": 19, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "datetime" + } + }, + { + "name": "order_state", + "notNull": true, + "length": 10, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "varchar" + } + }, + { + "name": "total_amount", + "notNull": true, + "length": 10, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "decimal" + } + } + ] + }, + { + "rel": { + "schema": "sales", + "name": "order_items" + }, + "columns": [ + { + "name": "order_item_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "name": "bigint" + } + }, + { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "name": "bigint" + } + }, + { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "name": "int" + } + }, + { + "name": "quantity", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "name": "int" + } + }, + { + "name": "unit_price", + "notNull": true, + "length": 10, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "name": "decimal" + } + } + ] + } + ] + } + ] + }, + "queries": [ + { + "text": "SELECT \n o.order_id, ordered_at, order_state, total_amount, order_item_id, i.quantity, i.unit_price, \n p.product_id, p.name as product_name, p.category as product_category\nFROM sales.orders o\nJOIN sales.order_items i\nUSING (order_id)\nJOIN sales.products p\nUSING (product_id)\nWHERE o.customer_id = ?\nORDER BY o.ordered_at DESC\nLIMIT ? OFFSET ?", + "name": "GetCustomerOrders", + "cmd": ":many", + "columns": [ + { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "bigint" + }, + "originalName": "order_id" + }, + { + "name": "ordered_at", + "notNull": true, + "length": 19, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "datetime" + }, + "originalName": "ordered_at" + }, + { + "name": "order_state", + "notNull": true, + "length": 10, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "varchar" + }, + "originalName": "order_state" + }, + { + "name": "total_amount", + "notNull": true, + "length": 10, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "decimal" + }, + "originalName": "total_amount" + }, + { + "name": "order_item_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "name": "bigint" + }, + "originalName": "order_item_id" + }, + { + "name": "quantity", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "name": "int" + }, + "originalName": "quantity" + }, + { + "name": "unit_price", + "notNull": true, + "length": 10, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "name": "decimal" + }, + "originalName": "unit_price" + }, + { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "int" + }, + "originalName": "product_id" + }, + { + "name": "product_name", + "notNull": true, + "length": 200, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "varchar" + }, + "originalName": "name" + }, + { + "name": "product_category", + "notNull": true, + "length": 100, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "varchar" + }, + "originalName": "category" + } + ], + "parameters": [ + { + "number": 1, + "column": { + "name": "customer_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "int" + }, + "originalName": "customer_id" + } + }, + { + "number": 2, + "column": { + "name": "limit", + "notNull": true, + "length": -1, + "type": { + "name": "integer" + } + } + }, + { + "number": 3, + "column": { + "name": "offset", + "notNull": true, + "length": -1, + "type": { + "name": "integer" + } + } + } + ], + "filename": "query.sql" + }, + { + "text": "INSERT INTO sales.customers (name, email, phone, address, registered_at) VALUES (?, ?, ?, ?, ?)", + "name": "AddCustomers", + "cmd": ":copyfrom", + "parameters": [ + { + "number": 1, + "column": { + "name": "name", + "notNull": true, + "length": 100, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "varchar" + }, + "originalName": "name" + } + }, + { + "number": 2, + "column": { + "name": "email", + "notNull": true, + "length": 255, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "varchar" + }, + "originalName": "email" + } + }, + { + "number": 3, + "column": { + "name": "phone", + "notNull": true, + "length": 50, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "varchar" + }, + "originalName": "phone" + } + }, + { + "number": 4, + "column": { + "name": "address", + "length": 255, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "varchar" + }, + "originalName": "address" + } + }, + { + "number": 5, + "column": { + "name": "registered_at", + "notNull": true, + "length": 19, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "datetime" + }, + "originalName": "registered_at" + } + } + ], + "filename": "query.sql", + "insert_into_table": { + "schema": "sales", + "name": "customers" + } + }, + { + "text": "INSERT INTO sales.products (name, category, unit_price, stock_quantity, description) VALUES (?, ?, ?, ?, ?)", + "name": "AddProducts", + "cmd": ":copyfrom", + "parameters": [ + { + "number": 1, + "column": { + "name": "name", + "notNull": true, + "length": 200, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "varchar" + }, + "originalName": "name" + } + }, + { + "number": 2, + "column": { + "name": "category", + "notNull": true, + "length": 100, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "varchar" + }, + "originalName": "category" + } + }, + { + "number": 3, + "column": { + "name": "unit_price", + "notNull": true, + "length": 10, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "decimal" + }, + "originalName": "unit_price" + } + }, + { + "number": 4, + "column": { + "name": "stock_quantity", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "int" + }, + "originalName": "stock_quantity" + } + }, + { + "number": 5, + "column": { + "name": "description", + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "text" + }, + "originalName": "description" + } + } + ], + "filename": "query.sql", + "insert_into_table": { + "schema": "sales", + "name": "products" + } + }, + { + "text": "INSERT INTO sales.orders (customer_id, order_state, total_amount) VALUES (?, ?, ?)", + "name": "AddOrders", + "cmd": ":copyfrom", + "parameters": [ + { + "number": 1, + "column": { + "name": "customer_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "int" + }, + "originalName": "customer_id" + } + }, + { + "number": 2, + "column": { + "name": "order_state", + "notNull": true, + "length": 10, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "varchar" + }, + "originalName": "order_state" + } + }, + { + "number": 3, + "column": { + "name": "total_amount", + "notNull": true, + "length": 10, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "decimal" + }, + "originalName": "total_amount" + } + } + ], + "filename": "query.sql", + "insert_into_table": { + "schema": "sales", + "name": "orders" + } + }, + { + "text": "INSERT INTO sales.order_items (order_id, product_id, quantity, unit_price) VALUES (?, ?, ?, ?)", + "name": "AddOrderItems", + "cmd": ":copyfrom", + "parameters": [ + { + "number": 1, + "column": { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "name": "bigint" + }, + "originalName": "order_id" + } + }, + { + "number": 2, + "column": { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "name": "int" + }, + "originalName": "product_id" + } + }, + { + "number": 3, + "column": { + "name": "quantity", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "name": "int" + }, + "originalName": "quantity" + } + }, + { + "number": 4, + "column": { + "name": "unit_price", + "notNull": true, + "length": 10, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "name": "decimal" + }, + "originalName": "unit_price" + } + } + ], + "filename": "query.sql", + "insert_into_table": { + "schema": "sales", + "name": "order_items" + } + }, + { + "text": "SELECT customer_id FROM sales.customers ORDER BY customer_id LIMIT ?", + "name": "GetCustomerIds", + "cmd": ":many", + "columns": [ + { + "name": "customer_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "int" + }, + "originalName": "customer_id" + } + ], + "parameters": [ + { + "number": 1, + "column": { + "name": "limit", + "notNull": true, + "length": -1, + "type": { + "name": "integer" + } + } + } + ], + "filename": "query.sql" + }, + { + "text": "SELECT product_id FROM sales.products ORDER BY product_id LIMIT ?", + "name": "GetProductIds", + "cmd": ":many", + "columns": [ + { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "int" + }, + "originalName": "product_id" + } + ], + "parameters": [ + { + "number": 1, + "column": { + "name": "limit", + "notNull": true, + "length": -1, + "type": { + "name": "integer" + } + } + } + ], + "filename": "query.sql" + }, + { + "text": "SELECT order_id FROM sales.orders ORDER BY order_id LIMIT ?", + "name": "GetOrderIds", + "cmd": ":many", + "columns": [ + { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "bigint" + }, + "originalName": "order_id" + } + ], + "parameters": [ + { + "number": 1, + "column": { + "name": "limit", + "notNull": true, + "length": -1, + "type": { + "name": "integer" + } + } + } + ], + "filename": "query.sql" + }, + { + "text": "SELECT COUNT(*) AS cnt FROM sales.order_items", + "name": "GetOrderItemsCount", + "cmd": ":one", + "columns": [ + { + "name": "cnt", + "notNull": true, + "length": -1, + "isFuncCall": true, + "type": { + "name": "bigint" + } + } + ], + "filename": "query.sql" + }, + { + "text": "SELECT order_id, total_amount FROM sales.orders WHERE order_id IN (/*SLICE:order_ids*/?)", + "name": "GetOrderAmounts", + "cmd": ":many", + "columns": [ + { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "bigint" + }, + "originalName": "order_id" + }, + { + "name": "total_amount", + "notNull": true, + "length": 10, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "decimal" + }, + "originalName": "total_amount" + } + ], + "parameters": [ + { + "number": 1, + "column": { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "bigint" + }, + "originalName": "order_id" + } + } + ], + "filename": "query.sql" + }, + { + "text": "SELECT product_id, unit_price FROM sales.products WHERE product_id IN (/*SLICE:product_ids*/?)", + "name": "GetProductPrices", + "cmd": ":many", + "columns": [ + { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "int" + }, + "originalName": "product_id" + }, + { + "name": "unit_price", + "notNull": true, + "length": 10, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "decimal" + }, + "originalName": "unit_price" + } + ], + "parameters": [ + { + "number": 1, + "column": { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "int" + }, + "originalName": "product_id" + } + } + ], + "filename": "query.sql" + } + ], + "sqlc_version": "v1.30.0", + "plugin_options": "eyJvdmVycmlkZURyaXZlclZlcnNpb24iOiIiLCJnZW5lcmF0ZUNzcHJvaiI6dHJ1ZSwidGFyZ2V0RnJhbWV3b3JrIjoibmV0OC4wIiwibmFtZXNwYWNlTmFtZSI6Ik15c3FsU3FsY0ltcGwiLCJ1c2VEYXBwZXIiOmZhbHNlLCJvdmVycmlkZURhcHBlclZlcnNpb24iOiIiLCJvdmVycmlkZXMiOm51bGwsImRlYnVnUmVxdWVzdCI6ZmFsc2UsInVzZUNlbnRyYWxQYWNrYWdlTWFuYWdlbWVudCI6ZmFsc2UsIndpdGhBc3luY1N1ZmZpeCI6dHJ1ZX0=" +} \ No newline at end of file diff --git a/benchmark/MysqlSqlcImpl/request.message b/benchmark/MysqlSqlcImpl/request.message new file mode 100644 index 00000000..7ae83b54 --- /dev/null +++ b/benchmark/MysqlSqlcImpl/request.message @@ -0,0 +1,139 @@ + +Ñ +2mysql*examples/config/mysql/benchmark/schema.sql")examples/config/mysql/benchmark/query.sqlbn +benchmark/MysqlSqlcImplcsharp5{"debugRequest":true,"namespaceName":"MysqlSqlcImpl"}* +./dist/LocalRunnerü public"public"ç sales± +sales customers5 + customer_id0ÿÿÿÿÿÿÿÿÿRsales customersbint) +name0dRsales customersb varchar+ +email0ÿRsales customersb varchar* +phone02Rsales customersb varchar+ +address0ÿRsales customersb varchar3 + registered_at0Rsales customersb +datetimeî +salesproducts3 + +product_id0ÿÿÿÿÿÿÿÿÿRsalesproductsbint) +name0ÈRsalesproductsb varchar, +category0dRsalesproductsb varchar. + +unit_price0 +Rsalesproductsb decimal7 +stock_quantity0ÿÿÿÿÿÿÿÿÿRsalesproductsbint3 + description0ÿÿÿÿÿÿÿÿÿRsalesproductsbtext- +added_at0Rsalesproductsb +datetime‡ +salesorders2 +order_id0ÿÿÿÿÿÿÿÿÿRsalesordersbbigint2 + customer_id0ÿÿÿÿÿÿÿÿÿRsalesordersbint- + +ordered_at0Rsalesordersb +datetime- + order_state0 +Rsalesordersb varchar. + total_amount0 +Rsalesordersb decimal® +sales order_items< + order_item_id0ÿÿÿÿÿÿÿÿÿRsales order_itemsbbigint7 +order_id0ÿÿÿÿÿÿÿÿÿRsales order_itemsbbigint6 + +product_id0ÿÿÿÿÿÿÿÿÿRsales order_itemsbint4 +quantity0ÿÿÿÿÿÿÿÿÿRsales order_itemsbint1 + +unit_price0 +Rsales order_itemsb decimal +ÜSELECT + o.order_id, ordered_at, order_state, total_amount, order_item_id, i.quantity, i.unit_price, + p.product_id, p.name as product_name, p.category as product_category +FROM sales.orders o +JOIN sales.order_items i +USING (order_id) +JOIN sales.products p +USING (product_id) +WHERE o.customer_id = ? +ORDER BY o.ordered_at DESC +LIMIT ? OFFSET ?GetCustomerOrders:many"< +order_id0ÿÿÿÿÿÿÿÿÿRsalesordersbbigintzorder_id"9 + +ordered_at0Rsalesordersb +datetimez +ordered_at": + order_state0 +Rsalesordersb varcharz order_state"< + total_amount0 +Rsalesordersb decimalz total_amount"K + order_item_id0ÿÿÿÿÿÿÿÿÿRsales order_itemsbbigintz order_item_id"> +quantity0ÿÿÿÿÿÿÿÿÿRsales order_itemsbintzquantity"= + +unit_price0 +Rsales order_itemsb decimalz +unit_price"? + +product_id0ÿÿÿÿÿÿÿÿÿRsalesproductsbintz +product_id"7 + product_name0ÈRsalesproductsb varcharzname"> +product_category0dRsalesproductsb varcharzcategory*C? + customer_id0ÿÿÿÿÿÿÿÿÿRsalesordersbintz customer_id*# +limit0ÿÿÿÿÿÿÿÿÿb integer*$ +offset0ÿÿÿÿÿÿÿÿÿb integer: query.sql¿ +_INSERT INTO sales.customers (name, email, phone, address, registered_at) VALUES (?, ?, ?, ?, ?) AddCustomers :copyfrom*3/ +name0dRsales customersb varcharzname*62 +email0ÿRsales customersb varcharzemail*51 +phone02Rsales customersb varcharzphone*84 +address0ÿRsales customersb varcharzaddress*FB + registered_at0Rsales customersb +datetimez registered_at: query.sqlBsales customersç +kINSERT INTO sales.products (name, category, unit_price, stock_quantity, description) VALUES (?, ?, ?, ?, ?) AddProducts :copyfrom*3/ +name0ÈRsalesproductsb varcharzname*:6 +category0dRsalesproductsb varcharzcategory*>: + +unit_price0 +Rsalesproductsb decimalz +unit_price*KG +stock_quantity0ÿÿÿÿÿÿÿÿÿRsalesproductsbintzstock_quantity*D@ + description0ÿÿÿÿÿÿÿÿÿRsalesproductsbtextz description: query.sqlBsalesproductsÍ +RINSERT INTO sales.orders (customer_id, order_state, total_amount) VALUES (?, ?, ?) AddOrders :copyfrom*C? + customer_id0ÿÿÿÿÿÿÿÿÿRsalesordersbintz customer_id*>: + order_state0 +Rsalesordersb varcharz order_state*@< + total_amount0 +Rsalesordersb decimalz total_amount: query.sqlBsalesorders± +^INSERT INTO sales.order_items (order_id, product_id, quantity, unit_price) VALUES (?, ?, ?, ?) AddOrderItems :copyfrom*EA +order_id0ÿÿÿÿÿÿÿÿÿRsales order_itemsbbigintzorder_id*FB + +product_id0ÿÿÿÿÿÿÿÿÿRsales order_itemsbintz +product_id*B> +quantity0ÿÿÿÿÿÿÿÿÿRsales order_itemsbintzquantity*A= + +unit_price0 +Rsales order_itemsb decimalz +unit_price: query.sqlBsales order_itemsÑ +DSELECT customer_id FROM sales.customers ORDER BY customer_id LIMIT ?GetCustomerIds:many"B + customer_id0ÿÿÿÿÿÿÿÿÿRsales customersbintz customer_id*# +limit0ÿÿÿÿÿÿÿÿÿb integer: query.sqlÊ +ASELECT product_id FROM sales.products ORDER BY product_id LIMIT ? GetProductIds:many"? + +product_id0ÿÿÿÿÿÿÿÿÿRsalesproductsbintz +product_id*# +limit0ÿÿÿÿÿÿÿÿÿb integer: query.sql¿ +;SELECT order_id FROM sales.orders ORDER BY order_id LIMIT ? GetOrderIds:many"< +order_id0ÿÿÿÿÿÿÿÿÿRsalesordersbbigintzorder_id*# +limit0ÿÿÿÿÿÿÿÿÿb integer: query.sqlt +-SELECT COUNT(*) AS cnt FROM sales.order_itemsGetOrderItemsCount:one" +cnt0ÿÿÿÿÿÿÿÿÿ@bbigint: query.sql» +XSELECT order_id, total_amount FROM sales.orders WHERE order_id IN (/*SLICE:order_ids*/?)GetOrderAmounts:many"< +order_id0ÿÿÿÿÿÿÿÿÿRsalesordersbbigintzorder_id"< + total_amount0 +Rsalesordersb decimalz total_amount*@< +order_id0ÿÿÿÿÿÿÿÿÿRsalesordersbbigintzorder_id: query.sqlÆ +^SELECT product_id, unit_price FROM sales.products WHERE product_id IN (/*SLICE:product_ids*/?)GetProductPrices:many"? + +product_id0ÿÿÿÿÿÿÿÿÿRsalesproductsbintz +product_id": + +unit_price0 +Rsalesproductsb decimalz +unit_price*C? + +product_id0ÿÿÿÿÿÿÿÿÿRsalesproductsbintz +product_id: query.sql"v1.30.0*û{"overrideDriverVersion":"","generateCsproj":true,"targetFramework":"net8.0","namespaceName":"MysqlSqlcImpl","useDapper":false,"overrideDapperVersion":"","overrides":null,"debugRequest":false,"useCentralPackageManagement":false,"withAsyncSuffix":true} \ No newline at end of file diff --git a/benchmark/PostgresqlEFCoreImpl/Models.cs b/benchmark/PostgresqlEFCoreImpl/Models.cs new file mode 100644 index 00000000..d8525354 --- /dev/null +++ b/benchmark/PostgresqlEFCoreImpl/Models.cs @@ -0,0 +1,134 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace PostgresEFCoreImpl; + +[Table("customers", Schema = "sales")] +public class Customer +{ + [Key] + [Column("customer_id")] + public int CustomerId { get; set; } + + [Required] + [Column("name")] + [MaxLength(100)] + public string Name { get; set; } = string.Empty; + + [Required] + [Column("email")] + [MaxLength(255)] + public string Email { get; set; } = string.Empty; + + [Required] + [Column("phone")] + [MaxLength(50)] + public string Phone { get; set; } = string.Empty; + + [Column("address")] + [MaxLength(255)] + public string? Address { get; set; } + + [Required] + [Column("registered_at")] + public DateTime RegisteredAt { get; set; } + + public ICollection Orders { get; set; } = new List(); +} + +[Table("products", Schema = "sales")] +public class Product +{ + [Key] + [Column("product_id")] + public int ProductId { get; set; } + + [Required] + [Column("name")] + [MaxLength(200)] + public string Name { get; set; } = string.Empty; + + [Required] + [Column("category")] + [MaxLength(100)] + public string Category { get; set; } = string.Empty; + + [Required] + [Column("unit_price", TypeName = "decimal(10,2)")] + public decimal UnitPrice { get; set; } + + [Required] + [Column("stock_quantity")] + public int StockQuantity { get; set; } + + [Column("description")] + public string? Description { get; set; } + + [Required] + [Column("added_at")] + public DateTime AddedAt { get; set; } + + public ICollection OrderItems { get; set; } = new List(); +} + +[Table("orders", Schema = "sales")] +public class Order +{ + [Key] + [Column("order_id")] + public int OrderId { get; set; } + + [Required] + [Column("customer_id")] + public int CustomerId { get; set; } + + [Required] + [Column("ordered_at")] + public DateTime OrderedAt { get; set; } + + [Required] + [Column("order_state")] + [MaxLength(10)] + public string OrderState { get; set; } = string.Empty; + + [Required] + [Column("total_amount", TypeName = "decimal(10,2)")] + public decimal TotalAmount { get; set; } + + [ForeignKey(nameof(CustomerId))] + public Customer Customer { get; set; } = null!; + + public ICollection OrderItems { get; set; } = new List(); +} + +[Table("order_items", Schema = "sales")] +public class OrderItem +{ + [Key] + [Column("order_item_id")] + public int OrderItemId { get; set; } + + [Required] + [Column("order_id")] + public int OrderId { get; set; } + + [Required] + [Column("product_id")] + public int ProductId { get; set; } + + [Required] + [Column("quantity")] + public int Quantity { get; set; } + + [Required] + [Column("unit_price", TypeName = "decimal(10,2)")] + public decimal UnitPrice { get; set; } + + [ForeignKey(nameof(OrderId))] + public Order Order { get; set; } = null!; + + [ForeignKey(nameof(ProductId))] + public Product Product { get; set; } = null!; +} \ No newline at end of file diff --git a/benchmark/PostgresqlEFCoreImpl/PostgresqlEFCoreImpl.csproj b/benchmark/PostgresqlEFCoreImpl/PostgresqlEFCoreImpl.csproj new file mode 100644 index 00000000..b1b1df88 --- /dev/null +++ b/benchmark/PostgresqlEFCoreImpl/PostgresqlEFCoreImpl.csproj @@ -0,0 +1,17 @@ + + + + net8.0 + PostgresEFCoreImpl + Library + enable + + + + + + + + + + diff --git a/benchmark/PostgresqlEFCoreImpl/Queries.cs b/benchmark/PostgresqlEFCoreImpl/Queries.cs new file mode 100644 index 00000000..c339dda8 --- /dev/null +++ b/benchmark/PostgresqlEFCoreImpl/Queries.cs @@ -0,0 +1,127 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace PostgresEFCoreImpl; + +public class Queries(SalesDbContext dbContext, bool useTracking = false) +{ + private readonly SalesDbContext _dbContext = dbContext; + private readonly bool _useTracking = useTracking; + + public DbContext DbContext => _dbContext; + + public record GetCustomerOrdersRow( + int OrderId, + DateTime OrderedAt, + string OrderState, + decimal TotalAmount, + int OrderItemId, + int Quantity, + decimal UnitPrice, + int ProductId, + string ProductName, + string ProductCategory + ); + + public record GetCustomerOrdersArgs(int CustomerId, int Offset, int Limit); + + /// + /// Get customer orders with all order items and product details, ordered by date descending with pagination + /// + public async Task> GetCustomerOrders(GetCustomerOrdersArgs args) + { + var ordersQuery = _dbContext.Orders.AsQueryable(); + var orderItemsQuery = _dbContext.OrderItems.AsQueryable(); + var productsQuery = _dbContext.Products.AsQueryable(); + + if (!_useTracking) + { + ordersQuery = ordersQuery.AsNoTracking(); + orderItemsQuery = orderItemsQuery.AsNoTracking(); + productsQuery = productsQuery.AsNoTracking(); + } + + var results = await (from o in ordersQuery + join i in orderItemsQuery on o.OrderId equals i.OrderId + join p in productsQuery on i.ProductId equals p.ProductId + where o.CustomerId == args.CustomerId + orderby o.OrderedAt descending + select new GetCustomerOrdersRow( + o.OrderId, + o.OrderedAt, + o.OrderState, + o.TotalAmount, + i.OrderItemId, + i.Quantity, + i.UnitPrice, + p.ProductId, + p.Name, + p.Category + )) + .Skip(args.Offset) + .Take(args.Limit) + .ToListAsync(); + return results; + } + public record AddProductsArgs(string Name, string Category, decimal UnitPrice, int StockQuantity, string? Description); + + public async Task AddProducts(List args) + { + var products = args.Select(a => new Product + { + Name = a.Name, + Category = a.Category, + UnitPrice = a.UnitPrice, + StockQuantity = a.StockQuantity, + Description = a.Description, + AddedAt = DateTime.UtcNow + }).ToList(); + + await _dbContext.Products.AddRangeAsync(products); + await _dbContext.SaveChangesAsync(); + _dbContext.ChangeTracker.Clear(); + } + + public record AddOrdersArgs(int CustomerId, string OrderState, decimal TotalAmount); + + /// + /// Bulk insert orders + /// + public async Task AddOrders(List args) + { + var orders = args.Select(a => new Order + { + CustomerId = a.CustomerId, + OrderState = a.OrderState, + TotalAmount = a.TotalAmount, + OrderedAt = DateTime.UtcNow + }).ToList(); + + await _dbContext.Orders.AddRangeAsync(orders); + await _dbContext.SaveChangesAsync(); + _dbContext.ChangeTracker.Clear(); + } + + public record AddOrderItemsArgs(int OrderId, int ProductId, int Quantity, decimal UnitPrice); + + /// + /// Bulk insert order items + /// + public async Task AddOrderItems(List args) + { + var orderItems = args.Select(a => new OrderItem + { + OrderId = a.OrderId, + ProductId = a.ProductId, + Quantity = a.Quantity, + UnitPrice = a.UnitPrice + }).ToList(); + + await _dbContext.OrderItems.AddRangeAsync(orderItems); + await _dbContext.SaveChangesAsync(); + _dbContext.ChangeTracker.Clear(); + } +} \ No newline at end of file diff --git a/benchmark/PostgresqlEFCoreImpl/SalesDbContext.cs b/benchmark/PostgresqlEFCoreImpl/SalesDbContext.cs new file mode 100644 index 00000000..e0b6aa2d --- /dev/null +++ b/benchmark/PostgresqlEFCoreImpl/SalesDbContext.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore; + +namespace PostgresEFCoreImpl; + +public class SalesDbContext(string connectionString) : DbContext +{ + public DbSet Customers { get; set; } = null!; + public DbSet Products { get; set; } = null!; + public DbSet Orders { get; set; } = null!; + public DbSet OrderItems { get; set; } = null!; + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + if (!optionsBuilder.IsConfigured) + optionsBuilder.UseNpgsql(connectionString); + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + } +} \ No newline at end of file diff --git a/benchmark/PostgresqlSqlcImpl/Models.cs b/benchmark/PostgresqlSqlcImpl/Models.cs new file mode 100644 index 00000000..b5e63d75 --- /dev/null +++ b/benchmark/PostgresqlSqlcImpl/Models.cs @@ -0,0 +1,11 @@ +// auto-generated by sqlc - do not edit +using NpgsqlTypes; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace PostgresSqlcImpl; +public readonly record struct SalesCustomer(int CustomerId, string Name, string Email, string Phone, string? Address, DateTime RegisteredAt); +public readonly record struct SalesProduct(int ProductId, string Name, string Category, decimal UnitPrice, int StockQuantity, string? Description, DateTime AddedAt); +public readonly record struct SalesOrder(int OrderId, int CustomerId, DateTime OrderedAt, string OrderState, decimal TotalAmount); +public readonly record struct SalesOrderItem(int OrderItemId, int OrderId, int ProductId, int Quantity, decimal UnitPrice); \ No newline at end of file diff --git a/benchmark/PostgresqlSqlcImpl/PostgresqlSqlcImpl.csproj b/benchmark/PostgresqlSqlcImpl/PostgresqlSqlcImpl.csproj new file mode 100644 index 00000000..5f549688 --- /dev/null +++ b/benchmark/PostgresqlSqlcImpl/PostgresqlSqlcImpl.csproj @@ -0,0 +1,20 @@ + + + + + + net8.0 + PostgresSqlcImpl + Library + enable + False + + + + + + + + \ No newline at end of file diff --git a/benchmark/PostgresqlSqlcImpl/QuerySql.cs b/benchmark/PostgresqlSqlcImpl/QuerySql.cs new file mode 100644 index 00000000..2a593389 --- /dev/null +++ b/benchmark/PostgresqlSqlcImpl/QuerySql.cs @@ -0,0 +1,451 @@ +// auto-generated by sqlc - do not edit +// ReSharper disable UseObjectOrCollectionInitializer +// ReSharper disable UseAwaitUsing +// ReSharper disable ConvertToUsingDeclaration +// ReSharper disable NotAccessedPositionalProperty.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +using Npgsql; +using NpgsqlTypes; +using System; +using System.Collections.Generic; +using System.Data; +using System.Threading; +using System.Threading.Tasks; + +namespace PostgresSqlcImpl; +public class QuerySql : IDisposable +{ + public QuerySql() + { + } + + public QuerySql(string connectionString) : this() + { + this.ConnectionString = connectionString; + _dataSource = new Lazy(() => NpgsqlDataSource.Create(connectionString!), LazyThreadSafetyMode.ExecutionAndPublication); + } + + private QuerySql(NpgsqlTransaction transaction) : this() + { + this.Transaction = transaction; + } + + public static QuerySql WithTransaction(NpgsqlTransaction transaction) + { + return new QuerySql(transaction); + } + + private NpgsqlTransaction? Transaction { get; } + private string? ConnectionString { get; } + + private readonly Lazy? _dataSource; + private NpgsqlDataSource GetDataSource() + { + if (_dataSource == null) + throw new InvalidOperationException("ConnectionString is required when not using a transaction"); + return _dataSource.Value; + } + + public void Dispose() + { + GC.SuppressFinalize(this); + if (_dataSource?.IsValueCreated == true) + _dataSource.Value.Dispose(); + } + + private const string GetCustomerOrdersSql = @"SELECT + o.order_id, ordered_at, order_state, total_amount, order_item_id, i.quantity, i.unit_price, + p.product_id, p.name as product_name, p.category as product_category + FROM sales.orders o + JOIN sales.order_items i + USING (order_id) + JOIN sales.products p + USING (product_id) + WHERE o.customer_id = @customer_id + ORDER BY o.ordered_at DESC + LIMIT @limit OFFSET @offset"; + public readonly record struct GetCustomerOrdersRow(int OrderId, DateTime OrderedAt, string OrderState, decimal TotalAmount, int OrderItemId, int Quantity, decimal UnitPrice, int ProductId, string ProductName, string ProductCategory); + public readonly record struct GetCustomerOrdersArgs(int CustomerId, int Offset, int Limit); + public async Task> GetCustomerOrdersAsync(GetCustomerOrdersArgs args) + { + if (this.Transaction == null) + { + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + using (var command = connection.CreateCommand()) + { + command.CommandText = GetCustomerOrdersSql; + command.Parameters.AddWithValue("@customer_id", args.CustomerId); + command.Parameters.AddWithValue("@offset", args.Offset); + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetCustomerOrdersRow { OrderId = reader.GetInt32(0), OrderedAt = reader.GetDateTime(1), OrderState = reader.GetString(2), TotalAmount = reader.GetDecimal(3), OrderItemId = reader.GetInt32(4), Quantity = reader.GetInt32(5), UnitPrice = reader.GetDecimal(6), ProductId = reader.GetInt32(7), ProductName = reader.GetString(8), ProductCategory = reader.GetString(9) }); + return result; + } + } + } + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetCustomerOrdersSql; + command.Transaction = this.Transaction; + command.Parameters.AddWithValue("@customer_id", args.CustomerId); + command.Parameters.AddWithValue("@offset", args.Offset); + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetCustomerOrdersRow { OrderId = reader.GetInt32(0), OrderedAt = reader.GetDateTime(1), OrderState = reader.GetString(2), TotalAmount = reader.GetDecimal(3), OrderItemId = reader.GetInt32(4), Quantity = reader.GetInt32(5), UnitPrice = reader.GetDecimal(6), ProductId = reader.GetInt32(7), ProductName = reader.GetString(8), ProductCategory = reader.GetString(9) }); + return result; + } + } + } + + private const string AddCustomersSql = "COPY sales.customers (name, email, phone, address, registered_at) FROM STDIN (FORMAT BINARY)"; + public readonly record struct AddCustomersArgs(string Name, string Email, string Phone, string? Address, DateTime RegisteredAt); + public async Task AddCustomersAsync(List args) + { + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + using (var writer = await connection.BeginBinaryImportAsync(AddCustomersSql)) + { + foreach (var row in args) + { + await writer.StartRowAsync(); + await writer.WriteAsync(row.Name); + await writer.WriteAsync(row.Email); + await writer.WriteAsync(row.Phone); + await writer.WriteAsync(row.Address ?? (object)DBNull.Value); + await writer.WriteAsync(row.RegisteredAt, NpgsqlDbType.Timestamp); + } + + await writer.CompleteAsync(); + } + } + } + + private const string AddProductsSql = "COPY sales.products (name, category, unit_price, stock_quantity, description) FROM STDIN (FORMAT BINARY)"; + public readonly record struct AddProductsArgs(string Name, string Category, decimal UnitPrice, int StockQuantity, string? Description); + public async Task AddProductsAsync(List args) + { + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + using (var writer = await connection.BeginBinaryImportAsync(AddProductsSql)) + { + foreach (var row in args) + { + await writer.StartRowAsync(); + await writer.WriteAsync(row.Name); + await writer.WriteAsync(row.Category); + await writer.WriteAsync(row.UnitPrice); + await writer.WriteAsync(row.StockQuantity); + await writer.WriteAsync(row.Description ?? (object)DBNull.Value); + } + + await writer.CompleteAsync(); + } + } + } + + private const string AddOrdersSql = "COPY sales.orders (customer_id, order_state, total_amount) FROM STDIN (FORMAT BINARY)"; + public readonly record struct AddOrdersArgs(int CustomerId, string OrderState, decimal TotalAmount); + public async Task AddOrdersAsync(List args) + { + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + using (var writer = await connection.BeginBinaryImportAsync(AddOrdersSql)) + { + foreach (var row in args) + { + await writer.StartRowAsync(); + await writer.WriteAsync(row.CustomerId); + await writer.WriteAsync(row.OrderState); + await writer.WriteAsync(row.TotalAmount); + } + + await writer.CompleteAsync(); + } + } + } + + private const string AddOrderItemsSql = "COPY sales.order_items (order_id, product_id, quantity, unit_price) FROM STDIN (FORMAT BINARY)"; + public readonly record struct AddOrderItemsArgs(int OrderId, int ProductId, int Quantity, decimal UnitPrice); + public async Task AddOrderItemsAsync(List args) + { + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + using (var writer = await connection.BeginBinaryImportAsync(AddOrderItemsSql)) + { + foreach (var row in args) + { + await writer.StartRowAsync(); + await writer.WriteAsync(row.OrderId); + await writer.WriteAsync(row.ProductId); + await writer.WriteAsync(row.Quantity); + await writer.WriteAsync(row.UnitPrice); + } + + await writer.CompleteAsync(); + } + } + } + + private const string GetCustomerIdsSql = "SELECT customer_id FROM sales.customers ORDER BY customer_id LIMIT @limit"; + public readonly record struct GetCustomerIdsRow(int CustomerId); + public readonly record struct GetCustomerIdsArgs(int Limit); + public async Task> GetCustomerIdsAsync(GetCustomerIdsArgs args) + { + if (this.Transaction == null) + { + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + using (var command = connection.CreateCommand()) + { + command.CommandText = GetCustomerIdsSql; + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetCustomerIdsRow { CustomerId = reader.GetInt32(0) }); + return result; + } + } + } + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetCustomerIdsSql; + command.Transaction = this.Transaction; + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetCustomerIdsRow { CustomerId = reader.GetInt32(0) }); + return result; + } + } + } + + private const string GetProductIdsSql = "SELECT product_id FROM sales.products ORDER BY product_id LIMIT @limit"; + public readonly record struct GetProductIdsRow(int ProductId); + public readonly record struct GetProductIdsArgs(int Limit); + public async Task> GetProductIdsAsync(GetProductIdsArgs args) + { + if (this.Transaction == null) + { + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + using (var command = connection.CreateCommand()) + { + command.CommandText = GetProductIdsSql; + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetProductIdsRow { ProductId = reader.GetInt32(0) }); + return result; + } + } + } + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetProductIdsSql; + command.Transaction = this.Transaction; + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetProductIdsRow { ProductId = reader.GetInt32(0) }); + return result; + } + } + } + + private const string GetOrderItemsCountSql = "SELECT COUNT(*) AS cnt FROM sales.order_items"; + public readonly record struct GetOrderItemsCountRow(long Cnt); + public async Task GetOrderItemsCountAsync() + { + if (this.Transaction == null) + { + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + using (var command = connection.CreateCommand()) + { + command.CommandText = GetOrderItemsCountSql; + using (var reader = await command.ExecuteReaderAsync()) + { + if (await reader.ReadAsync()) + { + return new GetOrderItemsCountRow + { + Cnt = reader.GetInt64(0) + }; + } + } + } + }; + return null; + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetOrderItemsCountSql; + command.Transaction = this.Transaction; + using (var reader = await command.ExecuteReaderAsync()) + { + if (await reader.ReadAsync()) + { + return new GetOrderItemsCountRow + { + Cnt = reader.GetInt64(0) + }; + } + } + } + + return null; + } + + private const string GetOrderIdsSql = "SELECT order_id FROM sales.orders ORDER BY ordered_at DESC LIMIT @limit"; + public readonly record struct GetOrderIdsRow(int OrderId); + public readonly record struct GetOrderIdsArgs(int Limit); + public async Task> GetOrderIdsAsync(GetOrderIdsArgs args) + { + if (this.Transaction == null) + { + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + using (var command = connection.CreateCommand()) + { + command.CommandText = GetOrderIdsSql; + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetOrderIdsRow { OrderId = reader.GetInt32(0) }); + return result; + } + } + } + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetOrderIdsSql; + command.Transaction = this.Transaction; + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetOrderIdsRow { OrderId = reader.GetInt32(0) }); + return result; + } + } + } + + private const string GetOrderAmountsSql = "SELECT order_id, total_amount FROM sales.orders WHERE order_id = ANY(@order_ids)"; + public readonly record struct GetOrderAmountsRow(int OrderId, decimal TotalAmount); + public readonly record struct GetOrderAmountsArgs(int OrderIds); + public async Task> GetOrderAmountsAsync(GetOrderAmountsArgs args) + { + if (this.Transaction == null) + { + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + using (var command = connection.CreateCommand()) + { + command.CommandText = GetOrderAmountsSql; + command.Parameters.AddWithValue("@order_ids", args.OrderIds); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetOrderAmountsRow { OrderId = reader.GetInt32(0), TotalAmount = reader.GetDecimal(1) }); + return result; + } + } + } + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetOrderAmountsSql; + command.Transaction = this.Transaction; + command.Parameters.AddWithValue("@order_ids", args.OrderIds); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetOrderAmountsRow { OrderId = reader.GetInt32(0), TotalAmount = reader.GetDecimal(1) }); + return result; + } + } + } + + private const string GetProductPricesSql = "SELECT product_id, unit_price FROM sales.products WHERE product_id = ANY(@product_ids)"; + public readonly record struct GetProductPricesRow(int ProductId, decimal UnitPrice); + public readonly record struct GetProductPricesArgs(int ProductIds); + public async Task> GetProductPricesAsync(GetProductPricesArgs args) + { + if (this.Transaction == null) + { + using (var connection = await GetDataSource().OpenConnectionAsync()) + { + using (var command = connection.CreateCommand()) + { + command.CommandText = GetProductPricesSql; + command.Parameters.AddWithValue("@product_ids", args.ProductIds); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetProductPricesRow { ProductId = reader.GetInt32(0), UnitPrice = reader.GetDecimal(1) }); + return result; + } + } + } + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetProductPricesSql; + command.Transaction = this.Transaction; + command.Parameters.AddWithValue("@product_ids", args.ProductIds); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetProductPricesRow { ProductId = reader.GetInt32(0), UnitPrice = reader.GetDecimal(1) }); + return result; + } + } + } +} \ No newline at end of file diff --git a/benchmark/PostgresqlSqlcImpl/query.sql b/benchmark/PostgresqlSqlcImpl/query.sql new file mode 100644 index 00000000..2008c992 --- /dev/null +++ b/benchmark/PostgresqlSqlcImpl/query.sql @@ -0,0 +1,21 @@ +-- name: GetCustomerOrders :many +SELECT + o.order_id, ordered_at, order_state, total_amount, order_item_id, i.quantity, i.unit_price, + p.product_id, p.name as product_name, p.category as product_category +FROM sales.orders o +JOIN sales.order_items i +USING (order_id) +JOIN sales.products p +USING (product_id) +WHERE o.customer_id = sqlc.arg('customer_id') +ORDER BY o.ordered_at DESC +LIMIT sqlc.arg('limit') OFFSET sqlc.arg('offset'); + +-- name: AddProducts :copyfrom +INSERT INTO sales.products (name, category, unit_price, stock_quantity, description) VALUES ($1, $2, $3, $4, $5); + +-- name: AddOrders :copyfrom +INSERT INTO sales.orders (customer_id, order_state, total_amount) VALUES ($1, $2, $3); + +-- name: AddOrderItems :copyfrom +INSERT INTO sales.order_items (order_id, product_id, quantity, unit_price) VALUES ($1, $2, $3, $4); \ No newline at end of file diff --git a/benchmark/PostgresqlSqlcImpl/request.json b/benchmark/PostgresqlSqlcImpl/request.json new file mode 100644 index 00000000..d3d12c7a --- /dev/null +++ b/benchmark/PostgresqlSqlcImpl/request.json @@ -0,0 +1,32939 @@ +{ + "settings": { + "version": "2", + "engine": "postgresql", + "schema": [ + "examples/config/postgresql/benchmark/schema.sql" + ], + "queries": [ + "examples/config/postgresql/benchmark/query.sql" + ], + "codegen": { + "out": "benchmark/PostgresqlSqlcImpl", + "plugin": "csharp", + "options": "eyJkZWJ1Z1JlcXVlc3QiOnRydWUsIm5hbWVzcGFjZU5hbWUiOiJQb3N0Z3Jlc1NxbGNJbXBsIn0=", + "process": { + "cmd": "./dist/LocalRunner" + } + } + }, + "catalog": { + "defaultSchema": "public", + "schemas": [ + { + "name": "public" + }, + { + "name": "pg_temp" + }, + { + "name": "pg_catalog", + "tables": [ + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "tid" + } + }, + { + "name": "aggfnoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "aggkind", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "char" + } + }, + { + "name": "aggnumdirectargs", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "int2" + } + }, + { + "name": "aggtransfn", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "aggfinalfn", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "aggcombinefn", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "aggserialfn", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "aggdeserialfn", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "aggmtransfn", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "aggminvtransfn", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "aggmfinalfn", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "aggfinalextra", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "bool" + } + }, + { + "name": "aggmfinalextra", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "bool" + } + }, + { + "name": "aggfinalmodify", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "char" + } + }, + { + "name": "aggmfinalmodify", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "char" + } + }, + { + "name": "aggsortop", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "oid" + } + }, + { + "name": "aggtranstype", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "oid" + } + }, + { + "name": "aggtransspace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "int4" + } + }, + { + "name": "aggmtranstype", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "oid" + } + }, + { + "name": "aggmtransspace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "int4" + } + }, + { + "name": "agginitval", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "text" + } + }, + { + "name": "aggminitval", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_aggregate" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_am" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_am" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_am" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_am" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_am" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_am" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_am" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_am" + }, + "type": { + "name": "oid" + } + }, + { + "name": "amname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_am" + }, + "type": { + "name": "name" + } + }, + { + "name": "amhandler", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_am" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "amtype", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_am" + }, + "type": { + "name": "char" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amop" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amop" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amop" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amop" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amop" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amop" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amop" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amop" + }, + "type": { + "name": "oid" + } + }, + { + "name": "amopfamily", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amop" + }, + "type": { + "name": "oid" + } + }, + { + "name": "amoplefttype", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amop" + }, + "type": { + "name": "oid" + } + }, + { + "name": "amoprighttype", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amop" + }, + "type": { + "name": "oid" + } + }, + { + "name": "amopstrategy", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amop" + }, + "type": { + "name": "int2" + } + }, + { + "name": "amoppurpose", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amop" + }, + "type": { + "name": "char" + } + }, + { + "name": "amopopr", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amop" + }, + "type": { + "name": "oid" + } + }, + { + "name": "amopmethod", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amop" + }, + "type": { + "name": "oid" + } + }, + { + "name": "amopsortfamily", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amop" + }, + "type": { + "name": "oid" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amproc" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amproc" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amproc" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amproc" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amproc" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amproc" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amproc" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amproc" + }, + "type": { + "name": "oid" + } + }, + { + "name": "amprocfamily", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amproc" + }, + "type": { + "name": "oid" + } + }, + { + "name": "amproclefttype", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amproc" + }, + "type": { + "name": "oid" + } + }, + { + "name": "amprocrighttype", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amproc" + }, + "type": { + "name": "oid" + } + }, + { + "name": "amprocnum", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amproc" + }, + "type": { + "name": "int2" + } + }, + { + "name": "amproc", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_amproc" + }, + "type": { + "name": "regproc" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attrdef" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attrdef" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attrdef" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attrdef" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attrdef" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attrdef" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attrdef" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attrdef" + }, + "type": { + "name": "oid" + } + }, + { + "name": "adrelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attrdef" + }, + "type": { + "name": "oid" + } + }, + { + "name": "adnum", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attrdef" + }, + "type": { + "name": "int2" + } + }, + { + "name": "adbin", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attrdef" + }, + "type": { + "name": "pg_node_tree" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "tid" + } + }, + { + "name": "attrelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "oid" + } + }, + { + "name": "attname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "name" + } + }, + { + "name": "atttypid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "oid" + } + }, + { + "name": "attstattarget", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "int4" + } + }, + { + "name": "attlen", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "int2" + } + }, + { + "name": "attnum", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "int2" + } + }, + { + "name": "attndims", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "int4" + } + }, + { + "name": "attcacheoff", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "int4" + } + }, + { + "name": "atttypmod", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "int4" + } + }, + { + "name": "attbyval", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "bool" + } + }, + { + "name": "attalign", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "char" + } + }, + { + "name": "attstorage", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "char" + } + }, + { + "name": "attcompression", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "char" + } + }, + { + "name": "attnotnull", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "bool" + } + }, + { + "name": "atthasdef", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "bool" + } + }, + { + "name": "atthasmissing", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "bool" + } + }, + { + "name": "attidentity", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "char" + } + }, + { + "name": "attgenerated", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "char" + } + }, + { + "name": "attisdropped", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "bool" + } + }, + { + "name": "attislocal", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "bool" + } + }, + { + "name": "attinhcount", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "int4" + } + }, + { + "name": "attcollation", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "oid" + } + }, + { + "name": "attacl", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "_aclitem" + } + }, + { + "name": "attoptions", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "_text" + } + }, + { + "name": "attfdwoptions", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "_text" + } + }, + { + "name": "attmissingval", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_attribute" + }, + "type": { + "name": "anyarray" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_auth_members" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_auth_members" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_auth_members" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_auth_members" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_auth_members" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_auth_members" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_auth_members" + }, + "type": { + "name": "tid" + } + }, + { + "name": "roleid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_auth_members" + }, + "type": { + "name": "oid" + } + }, + { + "name": "member", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_auth_members" + }, + "type": { + "name": "oid" + } + }, + { + "name": "grantor", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_auth_members" + }, + "type": { + "name": "oid" + } + }, + { + "name": "admin_option", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_auth_members" + }, + "type": { + "name": "bool" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "type": { + "name": "oid" + } + }, + { + "name": "rolname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "type": { + "name": "name" + } + }, + { + "name": "rolsuper", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "type": { + "name": "bool" + } + }, + { + "name": "rolinherit", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "type": { + "name": "bool" + } + }, + { + "name": "rolcreaterole", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "type": { + "name": "bool" + } + }, + { + "name": "rolcreatedb", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "type": { + "name": "bool" + } + }, + { + "name": "rolcanlogin", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "type": { + "name": "bool" + } + }, + { + "name": "rolreplication", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "type": { + "name": "bool" + } + }, + { + "name": "rolbypassrls", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "type": { + "name": "bool" + } + }, + { + "name": "rolconnlimit", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "type": { + "name": "int4" + } + }, + { + "name": "rolpassword", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "type": { + "name": "text" + } + }, + { + "name": "rolvaliduntil", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_authid" + }, + "type": { + "name": "timestamptz" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_available_extension_versions" + }, + "columns": [ + { + "name": "name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_available_extension_versions" + }, + "type": { + "name": "name" + } + }, + { + "name": "version", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_available_extension_versions" + }, + "type": { + "name": "text" + } + }, + { + "name": "installed", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_available_extension_versions" + }, + "type": { + "name": "bool" + } + }, + { + "name": "superuser", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_available_extension_versions" + }, + "type": { + "name": "bool" + } + }, + { + "name": "trusted", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_available_extension_versions" + }, + "type": { + "name": "bool" + } + }, + { + "name": "relocatable", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_available_extension_versions" + }, + "type": { + "name": "bool" + } + }, + { + "name": "schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_available_extension_versions" + }, + "type": { + "name": "name" + } + }, + { + "name": "requires", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_available_extension_versions" + }, + "type": { + "name": "_name" + } + }, + { + "name": "comment", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_available_extension_versions" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_available_extensions" + }, + "columns": [ + { + "name": "name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_available_extensions" + }, + "type": { + "name": "name" + } + }, + { + "name": "default_version", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_available_extensions" + }, + "type": { + "name": "text" + } + }, + { + "name": "installed_version", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_available_extensions" + }, + "type": { + "name": "text" + } + }, + { + "name": "comment", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_available_extensions" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_backend_memory_contexts" + }, + "columns": [ + { + "name": "name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_backend_memory_contexts" + }, + "type": { + "name": "text" + } + }, + { + "name": "ident", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_backend_memory_contexts" + }, + "type": { + "name": "text" + } + }, + { + "name": "parent", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_backend_memory_contexts" + }, + "type": { + "name": "text" + } + }, + { + "name": "level", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_backend_memory_contexts" + }, + "type": { + "name": "int4" + } + }, + { + "name": "total_bytes", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_backend_memory_contexts" + }, + "type": { + "name": "int8" + } + }, + { + "name": "total_nblocks", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_backend_memory_contexts" + }, + "type": { + "name": "int8" + } + }, + { + "name": "free_bytes", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_backend_memory_contexts" + }, + "type": { + "name": "int8" + } + }, + { + "name": "free_chunks", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_backend_memory_contexts" + }, + "type": { + "name": "int8" + } + }, + { + "name": "used_bytes", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_backend_memory_contexts" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cast" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cast" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cast" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cast" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cast" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cast" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cast" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cast" + }, + "type": { + "name": "oid" + } + }, + { + "name": "castsource", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cast" + }, + "type": { + "name": "oid" + } + }, + { + "name": "casttarget", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cast" + }, + "type": { + "name": "oid" + } + }, + { + "name": "castfunc", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cast" + }, + "type": { + "name": "oid" + } + }, + { + "name": "castcontext", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cast" + }, + "type": { + "name": "char" + } + }, + { + "name": "castmethod", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cast" + }, + "type": { + "name": "char" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "oid" + } + }, + { + "name": "relname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "name" + } + }, + { + "name": "relnamespace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "oid" + } + }, + { + "name": "reltype", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "oid" + } + }, + { + "name": "reloftype", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "oid" + } + }, + { + "name": "relowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "oid" + } + }, + { + "name": "relam", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "oid" + } + }, + { + "name": "relfilenode", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "oid" + } + }, + { + "name": "reltablespace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "oid" + } + }, + { + "name": "relpages", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "int4" + } + }, + { + "name": "reltuples", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "float4" + } + }, + { + "name": "relallvisible", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "int4" + } + }, + { + "name": "reltoastrelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "oid" + } + }, + { + "name": "relhasindex", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "bool" + } + }, + { + "name": "relisshared", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "bool" + } + }, + { + "name": "relpersistence", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "char" + } + }, + { + "name": "relkind", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "char" + } + }, + { + "name": "relnatts", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "int2" + } + }, + { + "name": "relchecks", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "int2" + } + }, + { + "name": "relhasrules", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "bool" + } + }, + { + "name": "relhastriggers", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "bool" + } + }, + { + "name": "relhassubclass", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "bool" + } + }, + { + "name": "relrowsecurity", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "bool" + } + }, + { + "name": "relforcerowsecurity", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "bool" + } + }, + { + "name": "relispopulated", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "bool" + } + }, + { + "name": "relreplident", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "char" + } + }, + { + "name": "relispartition", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "bool" + } + }, + { + "name": "relrewrite", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "oid" + } + }, + { + "name": "relfrozenxid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "xid" + } + }, + { + "name": "relminmxid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "xid" + } + }, + { + "name": "relacl", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "_aclitem" + } + }, + { + "name": "reloptions", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "_text" + } + }, + { + "name": "relpartbound", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_class" + }, + "type": { + "name": "pg_node_tree" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_collation" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_collation" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_collation" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_collation" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_collation" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_collation" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_collation" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_collation" + }, + "type": { + "name": "oid" + } + }, + { + "name": "collname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_collation" + }, + "type": { + "name": "name" + } + }, + { + "name": "collnamespace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_collation" + }, + "type": { + "name": "oid" + } + }, + { + "name": "collowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_collation" + }, + "type": { + "name": "oid" + } + }, + { + "name": "collprovider", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_collation" + }, + "type": { + "name": "char" + } + }, + { + "name": "collisdeterministic", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_collation" + }, + "type": { + "name": "bool" + } + }, + { + "name": "collencoding", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_collation" + }, + "type": { + "name": "int4" + } + }, + { + "name": "collcollate", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_collation" + }, + "type": { + "name": "text" + } + }, + { + "name": "collctype", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_collation" + }, + "type": { + "name": "text" + } + }, + { + "name": "colliculocale", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_collation" + }, + "type": { + "name": "text" + } + }, + { + "name": "collversion", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_collation" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_config" + }, + "columns": [ + { + "name": "name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_config" + }, + "type": { + "name": "text" + } + }, + { + "name": "setting", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_config" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "oid" + } + }, + { + "name": "conname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "name" + } + }, + { + "name": "connamespace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "oid" + } + }, + { + "name": "contype", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "char" + } + }, + { + "name": "condeferrable", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "bool" + } + }, + { + "name": "condeferred", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "bool" + } + }, + { + "name": "convalidated", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "bool" + } + }, + { + "name": "conrelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "oid" + } + }, + { + "name": "contypid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "oid" + } + }, + { + "name": "conindid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "oid" + } + }, + { + "name": "conparentid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "oid" + } + }, + { + "name": "confrelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "oid" + } + }, + { + "name": "confupdtype", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "char" + } + }, + { + "name": "confdeltype", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "char" + } + }, + { + "name": "confmatchtype", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "char" + } + }, + { + "name": "conislocal", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "bool" + } + }, + { + "name": "coninhcount", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "int4" + } + }, + { + "name": "connoinherit", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "bool" + } + }, + { + "name": "conkey", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "_int2" + } + }, + { + "name": "confkey", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "_int2" + } + }, + { + "name": "conpfeqop", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "_oid" + } + }, + { + "name": "conppeqop", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "_oid" + } + }, + { + "name": "conffeqop", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "_oid" + } + }, + { + "name": "confdelsetcols", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "_int2" + } + }, + { + "name": "conexclop", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "_oid" + } + }, + { + "name": "conbin", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_constraint" + }, + "type": { + "name": "pg_node_tree" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_conversion" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_conversion" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_conversion" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_conversion" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_conversion" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_conversion" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_conversion" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_conversion" + }, + "type": { + "name": "oid" + } + }, + { + "name": "conname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_conversion" + }, + "type": { + "name": "name" + } + }, + { + "name": "connamespace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_conversion" + }, + "type": { + "name": "oid" + } + }, + { + "name": "conowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_conversion" + }, + "type": { + "name": "oid" + } + }, + { + "name": "conforencoding", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_conversion" + }, + "type": { + "name": "int4" + } + }, + { + "name": "contoencoding", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_conversion" + }, + "type": { + "name": "int4" + } + }, + { + "name": "conproc", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_conversion" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "condefault", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_conversion" + }, + "type": { + "name": "bool" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cursors" + }, + "columns": [ + { + "name": "name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cursors" + }, + "type": { + "name": "text" + } + }, + { + "name": "statement", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cursors" + }, + "type": { + "name": "text" + } + }, + { + "name": "is_holdable", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cursors" + }, + "type": { + "name": "bool" + } + }, + { + "name": "is_binary", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cursors" + }, + "type": { + "name": "bool" + } + }, + { + "name": "is_scrollable", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cursors" + }, + "type": { + "name": "bool" + } + }, + { + "name": "creation_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_cursors" + }, + "type": { + "name": "timestamptz" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "oid" + } + }, + { + "name": "datname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "name" + } + }, + { + "name": "datdba", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "oid" + } + }, + { + "name": "encoding", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "int4" + } + }, + { + "name": "datlocprovider", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "char" + } + }, + { + "name": "datistemplate", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "bool" + } + }, + { + "name": "datallowconn", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "bool" + } + }, + { + "name": "datconnlimit", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "int4" + } + }, + { + "name": "datfrozenxid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "xid" + } + }, + { + "name": "datminmxid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "xid" + } + }, + { + "name": "dattablespace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "oid" + } + }, + { + "name": "datcollate", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "text" + } + }, + { + "name": "datctype", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "text" + } + }, + { + "name": "daticulocale", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "text" + } + }, + { + "name": "datcollversion", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "text" + } + }, + { + "name": "datacl", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_database" + }, + "type": { + "name": "_aclitem" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_db_role_setting" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_db_role_setting" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_db_role_setting" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_db_role_setting" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_db_role_setting" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_db_role_setting" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_db_role_setting" + }, + "type": { + "name": "tid" + } + }, + { + "name": "setdatabase", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_db_role_setting" + }, + "type": { + "name": "oid" + } + }, + { + "name": "setrole", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_db_role_setting" + }, + "type": { + "name": "oid" + } + }, + { + "name": "setconfig", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_db_role_setting" + }, + "type": { + "name": "_text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_default_acl" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_default_acl" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_default_acl" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_default_acl" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_default_acl" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_default_acl" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_default_acl" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_default_acl" + }, + "type": { + "name": "oid" + } + }, + { + "name": "defaclrole", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_default_acl" + }, + "type": { + "name": "oid" + } + }, + { + "name": "defaclnamespace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_default_acl" + }, + "type": { + "name": "oid" + } + }, + { + "name": "defaclobjtype", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_default_acl" + }, + "type": { + "name": "char" + } + }, + { + "name": "defaclacl", + "notNull": true, + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_default_acl" + }, + "type": { + "name": "_aclitem" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_depend" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_depend" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_depend" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_depend" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_depend" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_depend" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_depend" + }, + "type": { + "name": "tid" + } + }, + { + "name": "classid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_depend" + }, + "type": { + "name": "oid" + } + }, + { + "name": "objid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_depend" + }, + "type": { + "name": "oid" + } + }, + { + "name": "objsubid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_depend" + }, + "type": { + "name": "int4" + } + }, + { + "name": "refclassid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_depend" + }, + "type": { + "name": "oid" + } + }, + { + "name": "refobjid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_depend" + }, + "type": { + "name": "oid" + } + }, + { + "name": "refobjsubid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_depend" + }, + "type": { + "name": "int4" + } + }, + { + "name": "deptype", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_depend" + }, + "type": { + "name": "char" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_description" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_description" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_description" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_description" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_description" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_description" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_description" + }, + "type": { + "name": "tid" + } + }, + { + "name": "objoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_description" + }, + "type": { + "name": "oid" + } + }, + { + "name": "classoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_description" + }, + "type": { + "name": "oid" + } + }, + { + "name": "objsubid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_description" + }, + "type": { + "name": "int4" + } + }, + { + "name": "description", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_description" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_enum" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_enum" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_enum" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_enum" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_enum" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_enum" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_enum" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_enum" + }, + "type": { + "name": "oid" + } + }, + { + "name": "enumtypid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_enum" + }, + "type": { + "name": "oid" + } + }, + { + "name": "enumsortorder", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_enum" + }, + "type": { + "name": "float4" + } + }, + { + "name": "enumlabel", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_enum" + }, + "type": { + "name": "name" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_event_trigger" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_event_trigger" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_event_trigger" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_event_trigger" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_event_trigger" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_event_trigger" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_event_trigger" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_event_trigger" + }, + "type": { + "name": "oid" + } + }, + { + "name": "evtname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_event_trigger" + }, + "type": { + "name": "name" + } + }, + { + "name": "evtevent", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_event_trigger" + }, + "type": { + "name": "name" + } + }, + { + "name": "evtowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_event_trigger" + }, + "type": { + "name": "oid" + } + }, + { + "name": "evtfoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_event_trigger" + }, + "type": { + "name": "oid" + } + }, + { + "name": "evtenabled", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_event_trigger" + }, + "type": { + "name": "char" + } + }, + { + "name": "evttags", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_event_trigger" + }, + "type": { + "name": "_text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_extension" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_extension" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_extension" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_extension" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_extension" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_extension" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_extension" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_extension" + }, + "type": { + "name": "oid" + } + }, + { + "name": "extname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_extension" + }, + "type": { + "name": "name" + } + }, + { + "name": "extowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_extension" + }, + "type": { + "name": "oid" + } + }, + { + "name": "extnamespace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_extension" + }, + "type": { + "name": "oid" + } + }, + { + "name": "extrelocatable", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_extension" + }, + "type": { + "name": "bool" + } + }, + { + "name": "extversion", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_extension" + }, + "type": { + "name": "text" + } + }, + { + "name": "extconfig", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_extension" + }, + "type": { + "name": "_oid" + } + }, + { + "name": "extcondition", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_extension" + }, + "type": { + "name": "_text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_file_settings" + }, + "columns": [ + { + "name": "sourcefile", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_file_settings" + }, + "type": { + "name": "text" + } + }, + { + "name": "sourceline", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_file_settings" + }, + "type": { + "name": "int4" + } + }, + { + "name": "seqno", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_file_settings" + }, + "type": { + "name": "int4" + } + }, + { + "name": "name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_file_settings" + }, + "type": { + "name": "text" + } + }, + { + "name": "setting", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_file_settings" + }, + "type": { + "name": "text" + } + }, + { + "name": "applied", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_file_settings" + }, + "type": { + "name": "bool" + } + }, + { + "name": "error", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_file_settings" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_data_wrapper" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_data_wrapper" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_data_wrapper" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_data_wrapper" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_data_wrapper" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_data_wrapper" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_data_wrapper" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_data_wrapper" + }, + "type": { + "name": "oid" + } + }, + { + "name": "fdwname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_data_wrapper" + }, + "type": { + "name": "name" + } + }, + { + "name": "fdwowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_data_wrapper" + }, + "type": { + "name": "oid" + } + }, + { + "name": "fdwhandler", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_data_wrapper" + }, + "type": { + "name": "oid" + } + }, + { + "name": "fdwvalidator", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_data_wrapper" + }, + "type": { + "name": "oid" + } + }, + { + "name": "fdwacl", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_data_wrapper" + }, + "type": { + "name": "_aclitem" + } + }, + { + "name": "fdwoptions", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_data_wrapper" + }, + "type": { + "name": "_text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_server" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_server" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_server" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_server" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_server" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_server" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_server" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_server" + }, + "type": { + "name": "oid" + } + }, + { + "name": "srvname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_server" + }, + "type": { + "name": "name" + } + }, + { + "name": "srvowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_server" + }, + "type": { + "name": "oid" + } + }, + { + "name": "srvfdw", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_server" + }, + "type": { + "name": "oid" + } + }, + { + "name": "srvtype", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_server" + }, + "type": { + "name": "text" + } + }, + { + "name": "srvversion", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_server" + }, + "type": { + "name": "text" + } + }, + { + "name": "srvacl", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_server" + }, + "type": { + "name": "_aclitem" + } + }, + { + "name": "srvoptions", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_server" + }, + "type": { + "name": "_text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_table" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_table" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_table" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_table" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_table" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_table" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_table" + }, + "type": { + "name": "tid" + } + }, + { + "name": "ftrelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_table" + }, + "type": { + "name": "oid" + } + }, + { + "name": "ftserver", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_table" + }, + "type": { + "name": "oid" + } + }, + { + "name": "ftoptions", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_foreign_table" + }, + "type": { + "name": "_text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_group" + }, + "columns": [ + { + "name": "groname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_group" + }, + "type": { + "name": "name" + } + }, + { + "name": "grosysid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_group" + }, + "type": { + "name": "oid" + } + }, + { + "name": "grolist", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_group" + }, + "type": { + "name": "_oid" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_hba_file_rules" + }, + "columns": [ + { + "name": "line_number", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_hba_file_rules" + }, + "type": { + "name": "int4" + } + }, + { + "name": "type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_hba_file_rules" + }, + "type": { + "name": "text" + } + }, + { + "name": "database", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_hba_file_rules" + }, + "type": { + "name": "_text" + } + }, + { + "name": "user_name", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_hba_file_rules" + }, + "type": { + "name": "_text" + } + }, + { + "name": "address", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_hba_file_rules" + }, + "type": { + "name": "text" + } + }, + { + "name": "netmask", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_hba_file_rules" + }, + "type": { + "name": "text" + } + }, + { + "name": "auth_method", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_hba_file_rules" + }, + "type": { + "name": "text" + } + }, + { + "name": "options", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_hba_file_rules" + }, + "type": { + "name": "_text" + } + }, + { + "name": "error", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_hba_file_rules" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ident_file_mappings" + }, + "columns": [ + { + "name": "line_number", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ident_file_mappings" + }, + "type": { + "name": "int4" + } + }, + { + "name": "map_name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ident_file_mappings" + }, + "type": { + "name": "text" + } + }, + { + "name": "sys_name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ident_file_mappings" + }, + "type": { + "name": "text" + } + }, + { + "name": "pg_username", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ident_file_mappings" + }, + "type": { + "name": "text" + } + }, + { + "name": "error", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ident_file_mappings" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "tid" + } + }, + { + "name": "indexrelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "oid" + } + }, + { + "name": "indrelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "oid" + } + }, + { + "name": "indnatts", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "int2" + } + }, + { + "name": "indnkeyatts", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "int2" + } + }, + { + "name": "indisunique", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "bool" + } + }, + { + "name": "indnullsnotdistinct", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "bool" + } + }, + { + "name": "indisprimary", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "bool" + } + }, + { + "name": "indisexclusion", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "bool" + } + }, + { + "name": "indimmediate", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "bool" + } + }, + { + "name": "indisclustered", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "bool" + } + }, + { + "name": "indisvalid", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "bool" + } + }, + { + "name": "indcheckxmin", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "bool" + } + }, + { + "name": "indisready", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "bool" + } + }, + { + "name": "indislive", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "bool" + } + }, + { + "name": "indisreplident", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "bool" + } + }, + { + "name": "indkey", + "notNull": true, + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "int2vector" + } + }, + { + "name": "indcollation", + "notNull": true, + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "oidvector" + } + }, + { + "name": "indclass", + "notNull": true, + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "oidvector" + } + }, + { + "name": "indoption", + "notNull": true, + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "int2vector" + } + }, + { + "name": "indexprs", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "pg_node_tree" + } + }, + { + "name": "indpred", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_index" + }, + "type": { + "name": "pg_node_tree" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_indexes" + }, + "columns": [ + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "tablename", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "indexname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "tablespace", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "indexdef", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_indexes" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_inherits" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_inherits" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_inherits" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_inherits" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_inherits" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_inherits" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_inherits" + }, + "type": { + "name": "tid" + } + }, + { + "name": "inhrelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_inherits" + }, + "type": { + "name": "oid" + } + }, + { + "name": "inhparent", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_inherits" + }, + "type": { + "name": "oid" + } + }, + { + "name": "inhseqno", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_inherits" + }, + "type": { + "name": "int4" + } + }, + { + "name": "inhdetachpending", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_inherits" + }, + "type": { + "name": "bool" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_init_privs" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_init_privs" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_init_privs" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_init_privs" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_init_privs" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_init_privs" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_init_privs" + }, + "type": { + "name": "tid" + } + }, + { + "name": "objoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_init_privs" + }, + "type": { + "name": "oid" + } + }, + { + "name": "classoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_init_privs" + }, + "type": { + "name": "oid" + } + }, + { + "name": "objsubid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_init_privs" + }, + "type": { + "name": "int4" + } + }, + { + "name": "privtype", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_init_privs" + }, + "type": { + "name": "char" + } + }, + { + "name": "initprivs", + "notNull": true, + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_init_privs" + }, + "type": { + "name": "_aclitem" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_language" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_language" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_language" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_language" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_language" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_language" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_language" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_language" + }, + "type": { + "name": "oid" + } + }, + { + "name": "lanname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_language" + }, + "type": { + "name": "name" + } + }, + { + "name": "lanowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_language" + }, + "type": { + "name": "oid" + } + }, + { + "name": "lanispl", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_language" + }, + "type": { + "name": "bool" + } + }, + { + "name": "lanpltrusted", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_language" + }, + "type": { + "name": "bool" + } + }, + { + "name": "lanplcallfoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_language" + }, + "type": { + "name": "oid" + } + }, + { + "name": "laninline", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_language" + }, + "type": { + "name": "oid" + } + }, + { + "name": "lanvalidator", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_language" + }, + "type": { + "name": "oid" + } + }, + { + "name": "lanacl", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_language" + }, + "type": { + "name": "_aclitem" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject" + }, + "type": { + "name": "tid" + } + }, + { + "name": "loid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject" + }, + "type": { + "name": "oid" + } + }, + { + "name": "pageno", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject" + }, + "type": { + "name": "int4" + } + }, + { + "name": "data", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject" + }, + "type": { + "name": "bytea" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject_metadata" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject_metadata" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject_metadata" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject_metadata" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject_metadata" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject_metadata" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject_metadata" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject_metadata" + }, + "type": { + "name": "oid" + } + }, + { + "name": "lomowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject_metadata" + }, + "type": { + "name": "oid" + } + }, + { + "name": "lomacl", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_largeobject_metadata" + }, + "type": { + "name": "_aclitem" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_locks" + }, + "columns": [ + { + "name": "locktype", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_locks" + }, + "type": { + "name": "text" + } + }, + { + "name": "database", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_locks" + }, + "type": { + "name": "oid" + } + }, + { + "name": "relation", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_locks" + }, + "type": { + "name": "oid" + } + }, + { + "name": "page", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_locks" + }, + "type": { + "name": "int4" + } + }, + { + "name": "tuple", + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_locks" + }, + "type": { + "name": "int2" + } + }, + { + "name": "virtualxid", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_locks" + }, + "type": { + "name": "text" + } + }, + { + "name": "transactionid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_locks" + }, + "type": { + "name": "xid" + } + }, + { + "name": "classid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_locks" + }, + "type": { + "name": "oid" + } + }, + { + "name": "objid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_locks" + }, + "type": { + "name": "oid" + } + }, + { + "name": "objsubid", + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_locks" + }, + "type": { + "name": "int2" + } + }, + { + "name": "virtualtransaction", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_locks" + }, + "type": { + "name": "text" + } + }, + { + "name": "pid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_locks" + }, + "type": { + "name": "int4" + } + }, + { + "name": "mode", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_locks" + }, + "type": { + "name": "text" + } + }, + { + "name": "granted", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_locks" + }, + "type": { + "name": "bool" + } + }, + { + "name": "fastpath", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_locks" + }, + "type": { + "name": "bool" + } + }, + { + "name": "waitstart", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_locks" + }, + "type": { + "name": "timestamptz" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_matviews" + }, + "columns": [ + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_matviews" + }, + "type": { + "name": "name" + } + }, + { + "name": "matviewname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_matviews" + }, + "type": { + "name": "name" + } + }, + { + "name": "matviewowner", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_matviews" + }, + "type": { + "name": "name" + } + }, + { + "name": "tablespace", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_matviews" + }, + "type": { + "name": "name" + } + }, + { + "name": "hasindexes", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_matviews" + }, + "type": { + "name": "bool" + } + }, + { + "name": "ispopulated", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_matviews" + }, + "type": { + "name": "bool" + } + }, + { + "name": "definition", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_matviews" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_namespace" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_namespace" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_namespace" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_namespace" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_namespace" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_namespace" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_namespace" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_namespace" + }, + "type": { + "name": "oid" + } + }, + { + "name": "nspname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_namespace" + }, + "type": { + "name": "name" + } + }, + { + "name": "nspowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_namespace" + }, + "type": { + "name": "oid" + } + }, + { + "name": "nspacl", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_namespace" + }, + "type": { + "name": "_aclitem" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opclass" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opclass" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opclass" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opclass" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opclass" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opclass" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opclass" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opclass" + }, + "type": { + "name": "oid" + } + }, + { + "name": "opcmethod", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opclass" + }, + "type": { + "name": "oid" + } + }, + { + "name": "opcname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opclass" + }, + "type": { + "name": "name" + } + }, + { + "name": "opcnamespace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opclass" + }, + "type": { + "name": "oid" + } + }, + { + "name": "opcowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opclass" + }, + "type": { + "name": "oid" + } + }, + { + "name": "opcfamily", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opclass" + }, + "type": { + "name": "oid" + } + }, + { + "name": "opcintype", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opclass" + }, + "type": { + "name": "oid" + } + }, + { + "name": "opcdefault", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opclass" + }, + "type": { + "name": "bool" + } + }, + { + "name": "opckeytype", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opclass" + }, + "type": { + "name": "oid" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "oid" + } + }, + { + "name": "oprname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "name" + } + }, + { + "name": "oprnamespace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "oid" + } + }, + { + "name": "oprowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "oid" + } + }, + { + "name": "oprkind", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "char" + } + }, + { + "name": "oprcanmerge", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "bool" + } + }, + { + "name": "oprcanhash", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "bool" + } + }, + { + "name": "oprleft", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "oid" + } + }, + { + "name": "oprright", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "oid" + } + }, + { + "name": "oprresult", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "oid" + } + }, + { + "name": "oprcom", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "oid" + } + }, + { + "name": "oprnegate", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "oid" + } + }, + { + "name": "oprcode", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "oprrest", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "oprjoin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_operator" + }, + "type": { + "name": "regproc" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opfamily" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opfamily" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opfamily" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opfamily" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opfamily" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opfamily" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opfamily" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opfamily" + }, + "type": { + "name": "oid" + } + }, + { + "name": "opfmethod", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opfamily" + }, + "type": { + "name": "oid" + } + }, + { + "name": "opfname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opfamily" + }, + "type": { + "name": "name" + } + }, + { + "name": "opfnamespace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opfamily" + }, + "type": { + "name": "oid" + } + }, + { + "name": "opfowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_opfamily" + }, + "type": { + "name": "oid" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_parameter_acl" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_parameter_acl" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_parameter_acl" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_parameter_acl" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_parameter_acl" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_parameter_acl" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_parameter_acl" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_parameter_acl" + }, + "type": { + "name": "oid" + } + }, + { + "name": "parname", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_parameter_acl" + }, + "type": { + "name": "text" + } + }, + { + "name": "paracl", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_parameter_acl" + }, + "type": { + "name": "_aclitem" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_partitioned_table" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_partitioned_table" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_partitioned_table" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_partitioned_table" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_partitioned_table" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_partitioned_table" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_partitioned_table" + }, + "type": { + "name": "tid" + } + }, + { + "name": "partrelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_partitioned_table" + }, + "type": { + "name": "oid" + } + }, + { + "name": "partstrat", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_partitioned_table" + }, + "type": { + "name": "char" + } + }, + { + "name": "partnatts", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_partitioned_table" + }, + "type": { + "name": "int2" + } + }, + { + "name": "partdefid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_partitioned_table" + }, + "type": { + "name": "oid" + } + }, + { + "name": "partattrs", + "notNull": true, + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_partitioned_table" + }, + "type": { + "name": "int2vector" + } + }, + { + "name": "partclass", + "notNull": true, + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_partitioned_table" + }, + "type": { + "name": "oidvector" + } + }, + { + "name": "partcollation", + "notNull": true, + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_partitioned_table" + }, + "type": { + "name": "oidvector" + } + }, + { + "name": "partexprs", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_partitioned_table" + }, + "type": { + "name": "pg_node_tree" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policies" + }, + "columns": [ + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policies" + }, + "type": { + "name": "name" + } + }, + { + "name": "tablename", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policies" + }, + "type": { + "name": "name" + } + }, + { + "name": "policyname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policies" + }, + "type": { + "name": "name" + } + }, + { + "name": "permissive", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policies" + }, + "type": { + "name": "text" + } + }, + { + "name": "roles", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policies" + }, + "type": { + "name": "_name" + } + }, + { + "name": "cmd", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policies" + }, + "type": { + "name": "text" + } + }, + { + "name": "qual", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policies" + }, + "type": { + "name": "text" + } + }, + { + "name": "with_check", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policies" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policy" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policy" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policy" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policy" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policy" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policy" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policy" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policy" + }, + "type": { + "name": "oid" + } + }, + { + "name": "polname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policy" + }, + "type": { + "name": "name" + } + }, + { + "name": "polrelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policy" + }, + "type": { + "name": "oid" + } + }, + { + "name": "polcmd", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policy" + }, + "type": { + "name": "char" + } + }, + { + "name": "polpermissive", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policy" + }, + "type": { + "name": "bool" + } + }, + { + "name": "polroles", + "notNull": true, + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policy" + }, + "type": { + "name": "_oid" + } + }, + { + "name": "polqual", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policy" + }, + "type": { + "name": "pg_node_tree" + } + }, + { + "name": "polwithcheck", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_policy" + }, + "type": { + "name": "pg_node_tree" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_prepared_statements" + }, + "columns": [ + { + "name": "name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_prepared_statements" + }, + "type": { + "name": "text" + } + }, + { + "name": "statement", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_prepared_statements" + }, + "type": { + "name": "text" + } + }, + { + "name": "prepare_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_prepared_statements" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "parameter_types", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_prepared_statements" + }, + "type": { + "name": "_regtype" + } + }, + { + "name": "from_sql", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_prepared_statements" + }, + "type": { + "name": "bool" + } + }, + { + "name": "generic_plans", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_prepared_statements" + }, + "type": { + "name": "int8" + } + }, + { + "name": "custom_plans", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_prepared_statements" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_prepared_xacts" + }, + "columns": [ + { + "name": "transaction", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_prepared_xacts" + }, + "type": { + "name": "xid" + } + }, + { + "name": "gid", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_prepared_xacts" + }, + "type": { + "name": "text" + } + }, + { + "name": "prepared", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_prepared_xacts" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "owner", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_prepared_xacts" + }, + "type": { + "name": "name" + } + }, + { + "name": "database", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_prepared_xacts" + }, + "type": { + "name": "name" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "oid" + } + }, + { + "name": "proname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "name" + } + }, + { + "name": "pronamespace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "oid" + } + }, + { + "name": "proowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "oid" + } + }, + { + "name": "prolang", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "oid" + } + }, + { + "name": "procost", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "float4" + } + }, + { + "name": "prorows", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "float4" + } + }, + { + "name": "provariadic", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "oid" + } + }, + { + "name": "prosupport", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "prokind", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "char" + } + }, + { + "name": "prosecdef", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "bool" + } + }, + { + "name": "proleakproof", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "bool" + } + }, + { + "name": "proisstrict", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "bool" + } + }, + { + "name": "proretset", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "bool" + } + }, + { + "name": "provolatile", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "char" + } + }, + { + "name": "proparallel", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "char" + } + }, + { + "name": "pronargs", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "int2" + } + }, + { + "name": "pronargdefaults", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "int2" + } + }, + { + "name": "prorettype", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "oid" + } + }, + { + "name": "proargtypes", + "notNull": true, + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "oidvector" + } + }, + { + "name": "proallargtypes", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "_oid" + } + }, + { + "name": "proargmodes", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "_char" + } + }, + { + "name": "proargnames", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "_text" + } + }, + { + "name": "proargdefaults", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "pg_node_tree" + } + }, + { + "name": "protrftypes", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "_oid" + } + }, + { + "name": "prosrc", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "text" + } + }, + { + "name": "probin", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "text" + } + }, + { + "name": "prosqlbody", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "pg_node_tree" + } + }, + { + "name": "proconfig", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "_text" + } + }, + { + "name": "proacl", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_proc" + }, + "type": { + "name": "_aclitem" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication" + }, + "type": { + "name": "oid" + } + }, + { + "name": "pubname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication" + }, + "type": { + "name": "name" + } + }, + { + "name": "pubowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication" + }, + "type": { + "name": "oid" + } + }, + { + "name": "puballtables", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication" + }, + "type": { + "name": "bool" + } + }, + { + "name": "pubinsert", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication" + }, + "type": { + "name": "bool" + } + }, + { + "name": "pubupdate", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication" + }, + "type": { + "name": "bool" + } + }, + { + "name": "pubdelete", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication" + }, + "type": { + "name": "bool" + } + }, + { + "name": "pubtruncate", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication" + }, + "type": { + "name": "bool" + } + }, + { + "name": "pubviaroot", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication" + }, + "type": { + "name": "bool" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_namespace" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_namespace" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_namespace" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_namespace" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_namespace" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_namespace" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_namespace" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_namespace" + }, + "type": { + "name": "oid" + } + }, + { + "name": "pnpubid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_namespace" + }, + "type": { + "name": "oid" + } + }, + { + "name": "pnnspid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_namespace" + }, + "type": { + "name": "oid" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_rel" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_rel" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_rel" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_rel" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_rel" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_rel" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_rel" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_rel" + }, + "type": { + "name": "oid" + } + }, + { + "name": "prpubid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_rel" + }, + "type": { + "name": "oid" + } + }, + { + "name": "prrelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_rel" + }, + "type": { + "name": "oid" + } + }, + { + "name": "prqual", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_rel" + }, + "type": { + "name": "pg_node_tree" + } + }, + { + "name": "prattrs", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_rel" + }, + "type": { + "name": "int2vector" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_tables" + }, + "columns": [ + { + "name": "pubname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "tablename", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "attnames", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_tables" + }, + "type": { + "name": "_name" + } + }, + { + "name": "rowfilter", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_publication_tables" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_range" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_range" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_range" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_range" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_range" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_range" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_range" + }, + "type": { + "name": "tid" + } + }, + { + "name": "rngtypid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_range" + }, + "type": { + "name": "oid" + } + }, + { + "name": "rngsubtype", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_range" + }, + "type": { + "name": "oid" + } + }, + { + "name": "rngmultitypid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_range" + }, + "type": { + "name": "oid" + } + }, + { + "name": "rngcollation", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_range" + }, + "type": { + "name": "oid" + } + }, + { + "name": "rngsubopc", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_range" + }, + "type": { + "name": "oid" + } + }, + { + "name": "rngcanonical", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_range" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "rngsubdiff", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_range" + }, + "type": { + "name": "regproc" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_origin" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_origin" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_origin" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_origin" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_origin" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_origin" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_origin" + }, + "type": { + "name": "tid" + } + }, + { + "name": "roident", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_origin" + }, + "type": { + "name": "oid" + } + }, + { + "name": "roname", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_origin" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_origin_status" + }, + "columns": [ + { + "name": "local_id", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_origin_status" + }, + "type": { + "name": "oid" + } + }, + { + "name": "external_id", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_origin_status" + }, + "type": { + "name": "text" + } + }, + { + "name": "remote_lsn", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_origin_status" + }, + "type": { + "name": "pg_lsn" + } + }, + { + "name": "local_lsn", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_origin_status" + }, + "type": { + "name": "pg_lsn" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_slots" + }, + "columns": [ + { + "name": "slot_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_slots" + }, + "type": { + "name": "name" + } + }, + { + "name": "plugin", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_slots" + }, + "type": { + "name": "name" + } + }, + { + "name": "slot_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_slots" + }, + "type": { + "name": "text" + } + }, + { + "name": "datoid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_slots" + }, + "type": { + "name": "oid" + } + }, + { + "name": "database", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_slots" + }, + "type": { + "name": "name" + } + }, + { + "name": "temporary", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_slots" + }, + "type": { + "name": "bool" + } + }, + { + "name": "active", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_slots" + }, + "type": { + "name": "bool" + } + }, + { + "name": "active_pid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_slots" + }, + "type": { + "name": "int4" + } + }, + { + "name": "xmin", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_slots" + }, + "type": { + "name": "xid" + } + }, + { + "name": "catalog_xmin", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_slots" + }, + "type": { + "name": "xid" + } + }, + { + "name": "restart_lsn", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_slots" + }, + "type": { + "name": "pg_lsn" + } + }, + { + "name": "confirmed_flush_lsn", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_slots" + }, + "type": { + "name": "pg_lsn" + } + }, + { + "name": "wal_status", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_slots" + }, + "type": { + "name": "text" + } + }, + { + "name": "safe_wal_size", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_slots" + }, + "type": { + "name": "int8" + } + }, + { + "name": "two_phase", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_replication_slots" + }, + "type": { + "name": "bool" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rewrite" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rewrite" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rewrite" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rewrite" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rewrite" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rewrite" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rewrite" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rewrite" + }, + "type": { + "name": "oid" + } + }, + { + "name": "rulename", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rewrite" + }, + "type": { + "name": "name" + } + }, + { + "name": "ev_class", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rewrite" + }, + "type": { + "name": "oid" + } + }, + { + "name": "ev_type", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rewrite" + }, + "type": { + "name": "char" + } + }, + { + "name": "ev_enabled", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rewrite" + }, + "type": { + "name": "char" + } + }, + { + "name": "is_instead", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rewrite" + }, + "type": { + "name": "bool" + } + }, + { + "name": "ev_qual", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rewrite" + }, + "type": { + "name": "pg_node_tree" + } + }, + { + "name": "ev_action", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rewrite" + }, + "type": { + "name": "pg_node_tree" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_roles" + }, + "columns": [ + { + "name": "rolname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_roles" + }, + "type": { + "name": "name" + } + }, + { + "name": "rolsuper", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_roles" + }, + "type": { + "name": "bool" + } + }, + { + "name": "rolinherit", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_roles" + }, + "type": { + "name": "bool" + } + }, + { + "name": "rolcreaterole", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_roles" + }, + "type": { + "name": "bool" + } + }, + { + "name": "rolcreatedb", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_roles" + }, + "type": { + "name": "bool" + } + }, + { + "name": "rolcanlogin", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_roles" + }, + "type": { + "name": "bool" + } + }, + { + "name": "rolreplication", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_roles" + }, + "type": { + "name": "bool" + } + }, + { + "name": "rolconnlimit", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_roles" + }, + "type": { + "name": "int4" + } + }, + { + "name": "rolpassword", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_roles" + }, + "type": { + "name": "text" + } + }, + { + "name": "rolvaliduntil", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_roles" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "rolbypassrls", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_roles" + }, + "type": { + "name": "bool" + } + }, + { + "name": "rolconfig", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_roles" + }, + "type": { + "name": "_text" + } + }, + { + "name": "oid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_roles" + }, + "type": { + "name": "oid" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rules" + }, + "columns": [ + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rules" + }, + "type": { + "name": "name" + } + }, + { + "name": "tablename", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rules" + }, + "type": { + "name": "name" + } + }, + { + "name": "rulename", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rules" + }, + "type": { + "name": "name" + } + }, + { + "name": "definition", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_rules" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabel" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabel" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabel" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabel" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabel" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabel" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabel" + }, + "type": { + "name": "tid" + } + }, + { + "name": "objoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabel" + }, + "type": { + "name": "oid" + } + }, + { + "name": "classoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabel" + }, + "type": { + "name": "oid" + } + }, + { + "name": "objsubid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabel" + }, + "type": { + "name": "int4" + } + }, + { + "name": "provider", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabel" + }, + "type": { + "name": "text" + } + }, + { + "name": "label", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabel" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabels" + }, + "columns": [ + { + "name": "objoid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabels" + }, + "type": { + "name": "oid" + } + }, + { + "name": "classoid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabels" + }, + "type": { + "name": "oid" + } + }, + { + "name": "objsubid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabels" + }, + "type": { + "name": "int4" + } + }, + { + "name": "objtype", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabels" + }, + "type": { + "name": "text" + } + }, + { + "name": "objnamespace", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabels" + }, + "type": { + "name": "oid" + } + }, + { + "name": "objname", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabels" + }, + "type": { + "name": "text" + } + }, + { + "name": "provider", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabels" + }, + "type": { + "name": "text" + } + }, + { + "name": "label", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_seclabels" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequence" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequence" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequence" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequence" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequence" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequence" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequence" + }, + "type": { + "name": "tid" + } + }, + { + "name": "seqrelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequence" + }, + "type": { + "name": "oid" + } + }, + { + "name": "seqtypid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequence" + }, + "type": { + "name": "oid" + } + }, + { + "name": "seqstart", + "notNull": true, + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequence" + }, + "type": { + "name": "int8" + } + }, + { + "name": "seqincrement", + "notNull": true, + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequence" + }, + "type": { + "name": "int8" + } + }, + { + "name": "seqmax", + "notNull": true, + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequence" + }, + "type": { + "name": "int8" + } + }, + { + "name": "seqmin", + "notNull": true, + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequence" + }, + "type": { + "name": "int8" + } + }, + { + "name": "seqcache", + "notNull": true, + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequence" + }, + "type": { + "name": "int8" + } + }, + { + "name": "seqcycle", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequence" + }, + "type": { + "name": "bool" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequences" + }, + "columns": [ + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequences" + }, + "type": { + "name": "name" + } + }, + { + "name": "sequencename", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequences" + }, + "type": { + "name": "name" + } + }, + { + "name": "sequenceowner", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequences" + }, + "type": { + "name": "name" + } + }, + { + "name": "data_type", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequences" + }, + "type": { + "name": "regtype" + } + }, + { + "name": "start_value", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequences" + }, + "type": { + "name": "int8" + } + }, + { + "name": "min_value", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequences" + }, + "type": { + "name": "int8" + } + }, + { + "name": "max_value", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequences" + }, + "type": { + "name": "int8" + } + }, + { + "name": "increment_by", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequences" + }, + "type": { + "name": "int8" + } + }, + { + "name": "cycle", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequences" + }, + "type": { + "name": "bool" + } + }, + { + "name": "cache_size", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequences" + }, + "type": { + "name": "int8" + } + }, + { + "name": "last_value", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_sequences" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_settings" + }, + "columns": [ + { + "name": "name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_settings" + }, + "type": { + "name": "text" + } + }, + { + "name": "setting", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_settings" + }, + "type": { + "name": "text" + } + }, + { + "name": "unit", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_settings" + }, + "type": { + "name": "text" + } + }, + { + "name": "category", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_settings" + }, + "type": { + "name": "text" + } + }, + { + "name": "short_desc", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_settings" + }, + "type": { + "name": "text" + } + }, + { + "name": "extra_desc", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_settings" + }, + "type": { + "name": "text" + } + }, + { + "name": "context", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_settings" + }, + "type": { + "name": "text" + } + }, + { + "name": "vartype", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_settings" + }, + "type": { + "name": "text" + } + }, + { + "name": "source", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_settings" + }, + "type": { + "name": "text" + } + }, + { + "name": "min_val", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_settings" + }, + "type": { + "name": "text" + } + }, + { + "name": "max_val", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_settings" + }, + "type": { + "name": "text" + } + }, + { + "name": "enumvals", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_settings" + }, + "type": { + "name": "_text" + } + }, + { + "name": "boot_val", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_settings" + }, + "type": { + "name": "text" + } + }, + { + "name": "reset_val", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_settings" + }, + "type": { + "name": "text" + } + }, + { + "name": "sourcefile", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_settings" + }, + "type": { + "name": "text" + } + }, + { + "name": "sourceline", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_settings" + }, + "type": { + "name": "int4" + } + }, + { + "name": "pending_restart", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_settings" + }, + "type": { + "name": "bool" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shadow" + }, + "columns": [ + { + "name": "usename", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shadow" + }, + "type": { + "name": "name" + } + }, + { + "name": "usesysid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shadow" + }, + "type": { + "name": "oid" + } + }, + { + "name": "usecreatedb", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shadow" + }, + "type": { + "name": "bool" + } + }, + { + "name": "usesuper", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shadow" + }, + "type": { + "name": "bool" + } + }, + { + "name": "userepl", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shadow" + }, + "type": { + "name": "bool" + } + }, + { + "name": "usebypassrls", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shadow" + }, + "type": { + "name": "bool" + } + }, + { + "name": "passwd", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shadow" + }, + "type": { + "name": "text" + } + }, + { + "name": "valuntil", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shadow" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "useconfig", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shadow" + }, + "type": { + "name": "_text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdepend" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdepend" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdepend" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdepend" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdepend" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdepend" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdepend" + }, + "type": { + "name": "tid" + } + }, + { + "name": "dbid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdepend" + }, + "type": { + "name": "oid" + } + }, + { + "name": "classid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdepend" + }, + "type": { + "name": "oid" + } + }, + { + "name": "objid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdepend" + }, + "type": { + "name": "oid" + } + }, + { + "name": "objsubid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdepend" + }, + "type": { + "name": "int4" + } + }, + { + "name": "refclassid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdepend" + }, + "type": { + "name": "oid" + } + }, + { + "name": "refobjid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdepend" + }, + "type": { + "name": "oid" + } + }, + { + "name": "deptype", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdepend" + }, + "type": { + "name": "char" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdescription" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdescription" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdescription" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdescription" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdescription" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdescription" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdescription" + }, + "type": { + "name": "tid" + } + }, + { + "name": "objoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdescription" + }, + "type": { + "name": "oid" + } + }, + { + "name": "classoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdescription" + }, + "type": { + "name": "oid" + } + }, + { + "name": "description", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shdescription" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shmem_allocations" + }, + "columns": [ + { + "name": "name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shmem_allocations" + }, + "type": { + "name": "text" + } + }, + { + "name": "off", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shmem_allocations" + }, + "type": { + "name": "int8" + } + }, + { + "name": "size", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shmem_allocations" + }, + "type": { + "name": "int8" + } + }, + { + "name": "allocated_size", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shmem_allocations" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shseclabel" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shseclabel" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shseclabel" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shseclabel" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shseclabel" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shseclabel" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shseclabel" + }, + "type": { + "name": "tid" + } + }, + { + "name": "objoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shseclabel" + }, + "type": { + "name": "oid" + } + }, + { + "name": "classoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shseclabel" + }, + "type": { + "name": "oid" + } + }, + { + "name": "provider", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shseclabel" + }, + "type": { + "name": "text" + } + }, + { + "name": "label", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_shseclabel" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "columns": [ + { + "name": "datid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "oid" + } + }, + { + "name": "datname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "name" + } + }, + { + "name": "pid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "int4" + } + }, + { + "name": "leader_pid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "int4" + } + }, + { + "name": "usesysid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "oid" + } + }, + { + "name": "usename", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "name" + } + }, + { + "name": "application_name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "text" + } + }, + { + "name": "client_addr", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "inet" + } + }, + { + "name": "client_hostname", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "text" + } + }, + { + "name": "client_port", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "int4" + } + }, + { + "name": "backend_start", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "xact_start", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "query_start", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "state_change", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "wait_event_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "text" + } + }, + { + "name": "wait_event", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "text" + } + }, + { + "name": "state", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "text" + } + }, + { + "name": "backend_xid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "xid" + } + }, + { + "name": "backend_xmin", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "xid" + } + }, + { + "name": "query_id", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "int8" + } + }, + { + "name": "query", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "text" + } + }, + { + "name": "backend_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_activity" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_indexes" + }, + "columns": [ + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_indexes" + }, + "type": { + "name": "oid" + } + }, + { + "name": "indexrelid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_indexes" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "indexrelname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "idx_scan", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_indexes" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_tup_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_indexes" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_tup_fetch", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_indexes" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "columns": [ + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "seq_scan", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "seq_tup_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_scan", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_tup_fetch", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_ins", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_upd", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_del", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_hot_upd", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_live_tup", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_dead_tup", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_mod_since_analyze", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_ins_since_vacuum", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "last_vacuum", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "last_autovacuum", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "last_analyze", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "last_autoanalyze", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "vacuum_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "autovacuum_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "analyze_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "autoanalyze_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_all_tables" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_archiver" + }, + "columns": [ + { + "name": "archived_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_archiver" + }, + "type": { + "name": "int8" + } + }, + { + "name": "last_archived_wal", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_archiver" + }, + "type": { + "name": "text" + } + }, + { + "name": "last_archived_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_archiver" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "failed_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_archiver" + }, + "type": { + "name": "int8" + } + }, + { + "name": "last_failed_wal", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_archiver" + }, + "type": { + "name": "text" + } + }, + { + "name": "last_failed_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_archiver" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "stats_reset", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_archiver" + }, + "type": { + "name": "timestamptz" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_bgwriter" + }, + "columns": [ + { + "name": "checkpoints_timed", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_bgwriter" + }, + "type": { + "name": "int8" + } + }, + { + "name": "checkpoints_req", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_bgwriter" + }, + "type": { + "name": "int8" + } + }, + { + "name": "checkpoint_write_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_bgwriter" + }, + "type": { + "name": "float8" + } + }, + { + "name": "checkpoint_sync_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_bgwriter" + }, + "type": { + "name": "float8" + } + }, + { + "name": "buffers_checkpoint", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_bgwriter" + }, + "type": { + "name": "int8" + } + }, + { + "name": "buffers_clean", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_bgwriter" + }, + "type": { + "name": "int8" + } + }, + { + "name": "maxwritten_clean", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_bgwriter" + }, + "type": { + "name": "int8" + } + }, + { + "name": "buffers_backend", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_bgwriter" + }, + "type": { + "name": "int8" + } + }, + { + "name": "buffers_backend_fsync", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_bgwriter" + }, + "type": { + "name": "int8" + } + }, + { + "name": "buffers_alloc", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_bgwriter" + }, + "type": { + "name": "int8" + } + }, + { + "name": "stats_reset", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_bgwriter" + }, + "type": { + "name": "timestamptz" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "columns": [ + { + "name": "datid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "oid" + } + }, + { + "name": "datname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "name" + } + }, + { + "name": "numbackends", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int4" + } + }, + { + "name": "xact_commit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int8" + } + }, + { + "name": "xact_rollback", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int8" + } + }, + { + "name": "blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int8" + } + }, + { + "name": "blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int8" + } + }, + { + "name": "tup_returned", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int8" + } + }, + { + "name": "tup_fetched", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int8" + } + }, + { + "name": "tup_inserted", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int8" + } + }, + { + "name": "tup_updated", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int8" + } + }, + { + "name": "tup_deleted", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int8" + } + }, + { + "name": "conflicts", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int8" + } + }, + { + "name": "temp_files", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int8" + } + }, + { + "name": "temp_bytes", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int8" + } + }, + { + "name": "deadlocks", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int8" + } + }, + { + "name": "checksum_failures", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int8" + } + }, + { + "name": "checksum_last_failure", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "blk_read_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "float8" + } + }, + { + "name": "blk_write_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "float8" + } + }, + { + "name": "session_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "float8" + } + }, + { + "name": "active_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "float8" + } + }, + { + "name": "idle_in_transaction_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "float8" + } + }, + { + "name": "sessions", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int8" + } + }, + { + "name": "sessions_abandoned", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int8" + } + }, + { + "name": "sessions_fatal", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int8" + } + }, + { + "name": "sessions_killed", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "int8" + } + }, + { + "name": "stats_reset", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database" + }, + "type": { + "name": "timestamptz" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database_conflicts" + }, + "columns": [ + { + "name": "datid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database_conflicts" + }, + "type": { + "name": "oid" + } + }, + { + "name": "datname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database_conflicts" + }, + "type": { + "name": "name" + } + }, + { + "name": "confl_tablespace", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database_conflicts" + }, + "type": { + "name": "int8" + } + }, + { + "name": "confl_lock", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database_conflicts" + }, + "type": { + "name": "int8" + } + }, + { + "name": "confl_snapshot", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database_conflicts" + }, + "type": { + "name": "int8" + } + }, + { + "name": "confl_bufferpin", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database_conflicts" + }, + "type": { + "name": "int8" + } + }, + { + "name": "confl_deadlock", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_database_conflicts" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_gssapi" + }, + "columns": [ + { + "name": "pid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_gssapi" + }, + "type": { + "name": "int4" + } + }, + { + "name": "gss_authenticated", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_gssapi" + }, + "type": { + "name": "bool" + } + }, + { + "name": "principal", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_gssapi" + }, + "type": { + "name": "text" + } + }, + { + "name": "encrypted", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_gssapi" + }, + "type": { + "name": "bool" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_analyze" + }, + "columns": [ + { + "name": "pid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_analyze" + }, + "type": { + "name": "int4" + } + }, + { + "name": "datid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_analyze" + }, + "type": { + "name": "oid" + } + }, + { + "name": "datname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_analyze" + }, + "type": { + "name": "name" + } + }, + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_analyze" + }, + "type": { + "name": "oid" + } + }, + { + "name": "phase", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_analyze" + }, + "type": { + "name": "text" + } + }, + { + "name": "sample_blks_total", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_analyze" + }, + "type": { + "name": "int8" + } + }, + { + "name": "sample_blks_scanned", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_analyze" + }, + "type": { + "name": "int8" + } + }, + { + "name": "ext_stats_total", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_analyze" + }, + "type": { + "name": "int8" + } + }, + { + "name": "ext_stats_computed", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_analyze" + }, + "type": { + "name": "int8" + } + }, + { + "name": "child_tables_total", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_analyze" + }, + "type": { + "name": "int8" + } + }, + { + "name": "child_tables_done", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_analyze" + }, + "type": { + "name": "int8" + } + }, + { + "name": "current_child_table_relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_analyze" + }, + "type": { + "name": "oid" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_basebackup" + }, + "columns": [ + { + "name": "pid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_basebackup" + }, + "type": { + "name": "int4" + } + }, + { + "name": "phase", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_basebackup" + }, + "type": { + "name": "text" + } + }, + { + "name": "backup_total", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_basebackup" + }, + "type": { + "name": "int8" + } + }, + { + "name": "backup_streamed", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_basebackup" + }, + "type": { + "name": "int8" + } + }, + { + "name": "tablespaces_total", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_basebackup" + }, + "type": { + "name": "int8" + } + }, + { + "name": "tablespaces_streamed", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_basebackup" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_cluster" + }, + "columns": [ + { + "name": "pid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_cluster" + }, + "type": { + "name": "int4" + } + }, + { + "name": "datid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_cluster" + }, + "type": { + "name": "oid" + } + }, + { + "name": "datname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_cluster" + }, + "type": { + "name": "name" + } + }, + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_cluster" + }, + "type": { + "name": "oid" + } + }, + { + "name": "command", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_cluster" + }, + "type": { + "name": "text" + } + }, + { + "name": "phase", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_cluster" + }, + "type": { + "name": "text" + } + }, + { + "name": "cluster_index_relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_cluster" + }, + "type": { + "name": "oid" + } + }, + { + "name": "heap_tuples_scanned", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_cluster" + }, + "type": { + "name": "int8" + } + }, + { + "name": "heap_tuples_written", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_cluster" + }, + "type": { + "name": "int8" + } + }, + { + "name": "heap_blks_total", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_cluster" + }, + "type": { + "name": "int8" + } + }, + { + "name": "heap_blks_scanned", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_cluster" + }, + "type": { + "name": "int8" + } + }, + { + "name": "index_rebuild_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_cluster" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_copy" + }, + "columns": [ + { + "name": "pid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_copy" + }, + "type": { + "name": "int4" + } + }, + { + "name": "datid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_copy" + }, + "type": { + "name": "oid" + } + }, + { + "name": "datname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_copy" + }, + "type": { + "name": "name" + } + }, + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_copy" + }, + "type": { + "name": "oid" + } + }, + { + "name": "command", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_copy" + }, + "type": { + "name": "text" + } + }, + { + "name": "type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_copy" + }, + "type": { + "name": "text" + } + }, + { + "name": "bytes_processed", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_copy" + }, + "type": { + "name": "int8" + } + }, + { + "name": "bytes_total", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_copy" + }, + "type": { + "name": "int8" + } + }, + { + "name": "tuples_processed", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_copy" + }, + "type": { + "name": "int8" + } + }, + { + "name": "tuples_excluded", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_copy" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_create_index" + }, + "columns": [ + { + "name": "pid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_create_index" + }, + "type": { + "name": "int4" + } + }, + { + "name": "datid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_create_index" + }, + "type": { + "name": "oid" + } + }, + { + "name": "datname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_create_index" + }, + "type": { + "name": "name" + } + }, + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_create_index" + }, + "type": { + "name": "oid" + } + }, + { + "name": "index_relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_create_index" + }, + "type": { + "name": "oid" + } + }, + { + "name": "command", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_create_index" + }, + "type": { + "name": "text" + } + }, + { + "name": "phase", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_create_index" + }, + "type": { + "name": "text" + } + }, + { + "name": "lockers_total", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_create_index" + }, + "type": { + "name": "int8" + } + }, + { + "name": "lockers_done", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_create_index" + }, + "type": { + "name": "int8" + } + }, + { + "name": "current_locker_pid", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_create_index" + }, + "type": { + "name": "int8" + } + }, + { + "name": "blocks_total", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_create_index" + }, + "type": { + "name": "int8" + } + }, + { + "name": "blocks_done", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_create_index" + }, + "type": { + "name": "int8" + } + }, + { + "name": "tuples_total", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_create_index" + }, + "type": { + "name": "int8" + } + }, + { + "name": "tuples_done", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_create_index" + }, + "type": { + "name": "int8" + } + }, + { + "name": "partitions_total", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_create_index" + }, + "type": { + "name": "int8" + } + }, + { + "name": "partitions_done", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_create_index" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_vacuum" + }, + "columns": [ + { + "name": "pid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_vacuum" + }, + "type": { + "name": "int4" + } + }, + { + "name": "datid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_vacuum" + }, + "type": { + "name": "oid" + } + }, + { + "name": "datname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_vacuum" + }, + "type": { + "name": "name" + } + }, + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_vacuum" + }, + "type": { + "name": "oid" + } + }, + { + "name": "phase", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_vacuum" + }, + "type": { + "name": "text" + } + }, + { + "name": "heap_blks_total", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_vacuum" + }, + "type": { + "name": "int8" + } + }, + { + "name": "heap_blks_scanned", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_vacuum" + }, + "type": { + "name": "int8" + } + }, + { + "name": "heap_blks_vacuumed", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_vacuum" + }, + "type": { + "name": "int8" + } + }, + { + "name": "index_vacuum_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_vacuum" + }, + "type": { + "name": "int8" + } + }, + { + "name": "max_dead_tuples", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_vacuum" + }, + "type": { + "name": "int8" + } + }, + { + "name": "num_dead_tuples", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_progress_vacuum" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_recovery_prefetch" + }, + "columns": [ + { + "name": "stats_reset", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_recovery_prefetch" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "prefetch", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_recovery_prefetch" + }, + "type": { + "name": "int8" + } + }, + { + "name": "hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_recovery_prefetch" + }, + "type": { + "name": "int8" + } + }, + { + "name": "skip_init", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_recovery_prefetch" + }, + "type": { + "name": "int8" + } + }, + { + "name": "skip_new", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_recovery_prefetch" + }, + "type": { + "name": "int8" + } + }, + { + "name": "skip_fpw", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_recovery_prefetch" + }, + "type": { + "name": "int8" + } + }, + { + "name": "skip_rep", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_recovery_prefetch" + }, + "type": { + "name": "int8" + } + }, + { + "name": "wal_distance", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_recovery_prefetch" + }, + "type": { + "name": "int4" + } + }, + { + "name": "block_distance", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_recovery_prefetch" + }, + "type": { + "name": "int4" + } + }, + { + "name": "io_depth", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_recovery_prefetch" + }, + "type": { + "name": "int4" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "columns": [ + { + "name": "pid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "int4" + } + }, + { + "name": "usesysid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "oid" + } + }, + { + "name": "usename", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "name" + } + }, + { + "name": "application_name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "text" + } + }, + { + "name": "client_addr", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "inet" + } + }, + { + "name": "client_hostname", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "text" + } + }, + { + "name": "client_port", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "int4" + } + }, + { + "name": "backend_start", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "backend_xmin", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "xid" + } + }, + { + "name": "state", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "text" + } + }, + { + "name": "sent_lsn", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "pg_lsn" + } + }, + { + "name": "write_lsn", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "pg_lsn" + } + }, + { + "name": "flush_lsn", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "pg_lsn" + } + }, + { + "name": "replay_lsn", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "pg_lsn" + } + }, + { + "name": "write_lag", + "length": 16, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "interval" + } + }, + { + "name": "flush_lag", + "length": 16, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "interval" + } + }, + { + "name": "replay_lag", + "length": 16, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "interval" + } + }, + { + "name": "sync_priority", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "int4" + } + }, + { + "name": "sync_state", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "text" + } + }, + { + "name": "reply_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication" + }, + "type": { + "name": "timestamptz" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication_slots" + }, + "columns": [ + { + "name": "slot_name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication_slots" + }, + "type": { + "name": "text" + } + }, + { + "name": "spill_txns", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication_slots" + }, + "type": { + "name": "int8" + } + }, + { + "name": "spill_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication_slots" + }, + "type": { + "name": "int8" + } + }, + { + "name": "spill_bytes", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication_slots" + }, + "type": { + "name": "int8" + } + }, + { + "name": "stream_txns", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication_slots" + }, + "type": { + "name": "int8" + } + }, + { + "name": "stream_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication_slots" + }, + "type": { + "name": "int8" + } + }, + { + "name": "stream_bytes", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication_slots" + }, + "type": { + "name": "int8" + } + }, + { + "name": "total_txns", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication_slots" + }, + "type": { + "name": "int8" + } + }, + { + "name": "total_bytes", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication_slots" + }, + "type": { + "name": "int8" + } + }, + { + "name": "stats_reset", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_replication_slots" + }, + "type": { + "name": "timestamptz" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_slru" + }, + "columns": [ + { + "name": "name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_slru" + }, + "type": { + "name": "text" + } + }, + { + "name": "blks_zeroed", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_slru" + }, + "type": { + "name": "int8" + } + }, + { + "name": "blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_slru" + }, + "type": { + "name": "int8" + } + }, + { + "name": "blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_slru" + }, + "type": { + "name": "int8" + } + }, + { + "name": "blks_written", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_slru" + }, + "type": { + "name": "int8" + } + }, + { + "name": "blks_exists", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_slru" + }, + "type": { + "name": "int8" + } + }, + { + "name": "flushes", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_slru" + }, + "type": { + "name": "int8" + } + }, + { + "name": "truncates", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_slru" + }, + "type": { + "name": "int8" + } + }, + { + "name": "stats_reset", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_slru" + }, + "type": { + "name": "timestamptz" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_ssl" + }, + "columns": [ + { + "name": "pid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_ssl" + }, + "type": { + "name": "int4" + } + }, + { + "name": "ssl", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_ssl" + }, + "type": { + "name": "bool" + } + }, + { + "name": "version", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_ssl" + }, + "type": { + "name": "text" + } + }, + { + "name": "cipher", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_ssl" + }, + "type": { + "name": "text" + } + }, + { + "name": "bits", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_ssl" + }, + "type": { + "name": "int4" + } + }, + { + "name": "client_dn", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_ssl" + }, + "type": { + "name": "text" + } + }, + { + "name": "client_serial", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_ssl" + }, + "type": { + "name": "numeric" + } + }, + { + "name": "issuer_dn", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_ssl" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_subscription" + }, + "columns": [ + { + "name": "subid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_subscription" + }, + "type": { + "name": "oid" + } + }, + { + "name": "subname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_subscription" + }, + "type": { + "name": "name" + } + }, + { + "name": "pid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_subscription" + }, + "type": { + "name": "int4" + } + }, + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_subscription" + }, + "type": { + "name": "oid" + } + }, + { + "name": "received_lsn", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_subscription" + }, + "type": { + "name": "pg_lsn" + } + }, + { + "name": "last_msg_send_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_subscription" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "last_msg_receipt_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_subscription" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "latest_end_lsn", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_subscription" + }, + "type": { + "name": "pg_lsn" + } + }, + { + "name": "latest_end_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_subscription" + }, + "type": { + "name": "timestamptz" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_subscription_stats" + }, + "columns": [ + { + "name": "subid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_subscription_stats" + }, + "type": { + "name": "oid" + } + }, + { + "name": "subname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_subscription_stats" + }, + "type": { + "name": "name" + } + }, + { + "name": "apply_error_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_subscription_stats" + }, + "type": { + "name": "int8" + } + }, + { + "name": "sync_error_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_subscription_stats" + }, + "type": { + "name": "int8" + } + }, + { + "name": "stats_reset", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_subscription_stats" + }, + "type": { + "name": "timestamptz" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_indexes" + }, + "columns": [ + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_indexes" + }, + "type": { + "name": "oid" + } + }, + { + "name": "indexrelid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_indexes" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "indexrelname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "idx_scan", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_indexes" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_tup_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_indexes" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_tup_fetch", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_indexes" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "columns": [ + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "seq_scan", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "seq_tup_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_scan", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_tup_fetch", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_ins", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_upd", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_del", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_hot_upd", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_live_tup", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_dead_tup", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_mod_since_analyze", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_ins_since_vacuum", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "last_vacuum", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "last_autovacuum", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "last_analyze", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "last_autoanalyze", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "vacuum_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "autovacuum_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "analyze_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "autoanalyze_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_sys_tables" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_functions" + }, + "columns": [ + { + "name": "funcid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_functions" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_functions" + }, + "type": { + "name": "name" + } + }, + { + "name": "funcname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_functions" + }, + "type": { + "name": "name" + } + }, + { + "name": "calls", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_functions" + }, + "type": { + "name": "int8" + } + }, + { + "name": "total_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_functions" + }, + "type": { + "name": "float8" + } + }, + { + "name": "self_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_functions" + }, + "type": { + "name": "float8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_indexes" + }, + "columns": [ + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_indexes" + }, + "type": { + "name": "oid" + } + }, + { + "name": "indexrelid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_indexes" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "indexrelname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "idx_scan", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_indexes" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_tup_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_indexes" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_tup_fetch", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_indexes" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "columns": [ + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "seq_scan", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "seq_tup_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_scan", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_tup_fetch", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_ins", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_upd", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_del", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_hot_upd", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_live_tup", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_dead_tup", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_mod_since_analyze", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_ins_since_vacuum", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "last_vacuum", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "last_autovacuum", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "last_analyze", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "last_autoanalyze", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "vacuum_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "autovacuum_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "analyze_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "autoanalyze_count", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_user_tables" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal" + }, + "columns": [ + { + "name": "wal_records", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal" + }, + "type": { + "name": "int8" + } + }, + { + "name": "wal_fpi", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal" + }, + "type": { + "name": "int8" + } + }, + { + "name": "wal_bytes", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal" + }, + "type": { + "name": "numeric" + } + }, + { + "name": "wal_buffers_full", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal" + }, + "type": { + "name": "int8" + } + }, + { + "name": "wal_write", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal" + }, + "type": { + "name": "int8" + } + }, + { + "name": "wal_sync", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal" + }, + "type": { + "name": "int8" + } + }, + { + "name": "wal_write_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal" + }, + "type": { + "name": "float8" + } + }, + { + "name": "wal_sync_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal" + }, + "type": { + "name": "float8" + } + }, + { + "name": "stats_reset", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal" + }, + "type": { + "name": "timestamptz" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal_receiver" + }, + "columns": [ + { + "name": "pid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal_receiver" + }, + "type": { + "name": "int4" + } + }, + { + "name": "status", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal_receiver" + }, + "type": { + "name": "text" + } + }, + { + "name": "receive_start_lsn", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal_receiver" + }, + "type": { + "name": "pg_lsn" + } + }, + { + "name": "receive_start_tli", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal_receiver" + }, + "type": { + "name": "int4" + } + }, + { + "name": "written_lsn", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal_receiver" + }, + "type": { + "name": "pg_lsn" + } + }, + { + "name": "flushed_lsn", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal_receiver" + }, + "type": { + "name": "pg_lsn" + } + }, + { + "name": "received_tli", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal_receiver" + }, + "type": { + "name": "int4" + } + }, + { + "name": "last_msg_send_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal_receiver" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "last_msg_receipt_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal_receiver" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "latest_end_lsn", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal_receiver" + }, + "type": { + "name": "pg_lsn" + } + }, + { + "name": "latest_end_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal_receiver" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "slot_name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal_receiver" + }, + "type": { + "name": "text" + } + }, + { + "name": "sender_host", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal_receiver" + }, + "type": { + "name": "text" + } + }, + { + "name": "sender_port", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal_receiver" + }, + "type": { + "name": "int4" + } + }, + { + "name": "conninfo", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_wal_receiver" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_all_tables" + }, + "columns": [ + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_all_tables" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_all_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_all_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "seq_scan", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "seq_tup_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_scan", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_tup_fetch", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_ins", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_upd", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_del", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_hot_upd", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_all_tables" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_sys_tables" + }, + "columns": [ + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_sys_tables" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_sys_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_sys_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "seq_scan", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "seq_tup_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_scan", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_tup_fetch", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_ins", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_upd", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_del", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_hot_upd", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_sys_tables" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_functions" + }, + "columns": [ + { + "name": "funcid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_functions" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_functions" + }, + "type": { + "name": "name" + } + }, + { + "name": "funcname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_functions" + }, + "type": { + "name": "name" + } + }, + { + "name": "calls", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_functions" + }, + "type": { + "name": "int8" + } + }, + { + "name": "total_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_functions" + }, + "type": { + "name": "float8" + } + }, + { + "name": "self_time", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_functions" + }, + "type": { + "name": "float8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_tables" + }, + "columns": [ + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_tables" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "seq_scan", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "seq_tup_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_scan", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_tup_fetch", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_ins", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_upd", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_del", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "n_tup_hot_upd", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stat_xact_user_tables" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_indexes" + }, + "columns": [ + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_indexes" + }, + "type": { + "name": "oid" + } + }, + { + "name": "indexrelid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_indexes" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "indexrelname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "idx_blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_indexes" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_indexes" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_sequences" + }, + "columns": [ + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_sequences" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_sequences" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_sequences" + }, + "type": { + "name": "name" + } + }, + { + "name": "blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_sequences" + }, + "type": { + "name": "int8" + } + }, + { + "name": "blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_sequences" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_tables" + }, + "columns": [ + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_tables" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "heap_blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "heap_blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "toast_blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "toast_blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "tidx_blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "tidx_blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_all_tables" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_indexes" + }, + "columns": [ + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_indexes" + }, + "type": { + "name": "oid" + } + }, + { + "name": "indexrelid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_indexes" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "indexrelname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "idx_blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_indexes" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_indexes" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_sequences" + }, + "columns": [ + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_sequences" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_sequences" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_sequences" + }, + "type": { + "name": "name" + } + }, + { + "name": "blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_sequences" + }, + "type": { + "name": "int8" + } + }, + { + "name": "blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_sequences" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_tables" + }, + "columns": [ + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_tables" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "heap_blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "heap_blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "toast_blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "toast_blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "tidx_blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "tidx_blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_sys_tables" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_indexes" + }, + "columns": [ + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_indexes" + }, + "type": { + "name": "oid" + } + }, + { + "name": "indexrelid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_indexes" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "indexrelname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_indexes" + }, + "type": { + "name": "name" + } + }, + { + "name": "idx_blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_indexes" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_indexes" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_sequences" + }, + "columns": [ + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_sequences" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_sequences" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_sequences" + }, + "type": { + "name": "name" + } + }, + { + "name": "blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_sequences" + }, + "type": { + "name": "int8" + } + }, + { + "name": "blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_sequences" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_tables" + }, + "columns": [ + { + "name": "relid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_tables" + }, + "type": { + "name": "oid" + } + }, + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "heap_blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "heap_blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "idx_blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "toast_blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "toast_blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "tidx_blks_read", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_tables" + }, + "type": { + "name": "int8" + } + }, + { + "name": "tidx_blks_hit", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statio_user_tables" + }, + "type": { + "name": "int8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "tid" + } + }, + { + "name": "starelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "oid" + } + }, + { + "name": "staattnum", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "int2" + } + }, + { + "name": "stainherit", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "bool" + } + }, + { + "name": "stanullfrac", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "float4" + } + }, + { + "name": "stawidth", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "int4" + } + }, + { + "name": "stadistinct", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "float4" + } + }, + { + "name": "stakind1", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "int2" + } + }, + { + "name": "stakind2", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "int2" + } + }, + { + "name": "stakind3", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "int2" + } + }, + { + "name": "stakind4", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "int2" + } + }, + { + "name": "stakind5", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "int2" + } + }, + { + "name": "staop1", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "oid" + } + }, + { + "name": "staop2", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "oid" + } + }, + { + "name": "staop3", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "oid" + } + }, + { + "name": "staop4", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "oid" + } + }, + { + "name": "staop5", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "oid" + } + }, + { + "name": "stacoll1", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "oid" + } + }, + { + "name": "stacoll2", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "oid" + } + }, + { + "name": "stacoll3", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "oid" + } + }, + { + "name": "stacoll4", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "oid" + } + }, + { + "name": "stacoll5", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "oid" + } + }, + { + "name": "stanumbers1", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "_float4" + } + }, + { + "name": "stanumbers2", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "_float4" + } + }, + { + "name": "stanumbers3", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "_float4" + } + }, + { + "name": "stanumbers4", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "_float4" + } + }, + { + "name": "stanumbers5", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "_float4" + } + }, + { + "name": "stavalues1", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "anyarray" + } + }, + { + "name": "stavalues2", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "anyarray" + } + }, + { + "name": "stavalues3", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "anyarray" + } + }, + { + "name": "stavalues4", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "anyarray" + } + }, + { + "name": "stavalues5", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic" + }, + "type": { + "name": "anyarray" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext" + }, + "type": { + "name": "oid" + } + }, + { + "name": "stxrelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext" + }, + "type": { + "name": "oid" + } + }, + { + "name": "stxname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext" + }, + "type": { + "name": "name" + } + }, + { + "name": "stxnamespace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext" + }, + "type": { + "name": "oid" + } + }, + { + "name": "stxowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext" + }, + "type": { + "name": "oid" + } + }, + { + "name": "stxstattarget", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext" + }, + "type": { + "name": "int4" + } + }, + { + "name": "stxkeys", + "notNull": true, + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext" + }, + "type": { + "name": "int2vector" + } + }, + { + "name": "stxkind", + "notNull": true, + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext" + }, + "type": { + "name": "_char" + } + }, + { + "name": "stxexprs", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext" + }, + "type": { + "name": "pg_node_tree" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext_data" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext_data" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext_data" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext_data" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext_data" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext_data" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext_data" + }, + "type": { + "name": "tid" + } + }, + { + "name": "stxoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext_data" + }, + "type": { + "name": "oid" + } + }, + { + "name": "stxdinherit", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext_data" + }, + "type": { + "name": "bool" + } + }, + { + "name": "stxdndistinct", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext_data" + }, + "type": { + "name": "pg_ndistinct" + } + }, + { + "name": "stxddependencies", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext_data" + }, + "type": { + "name": "pg_dependencies" + } + }, + { + "name": "stxdmcv", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext_data" + }, + "type": { + "name": "pg_mcv_list" + } + }, + { + "name": "stxdexpr", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_statistic_ext_data" + }, + "type": { + "name": "_pg_statistic" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats" + }, + "columns": [ + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats" + }, + "type": { + "name": "name" + } + }, + { + "name": "tablename", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats" + }, + "type": { + "name": "name" + } + }, + { + "name": "attname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats" + }, + "type": { + "name": "name" + } + }, + { + "name": "inherited", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats" + }, + "type": { + "name": "bool" + } + }, + { + "name": "null_frac", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats" + }, + "type": { + "name": "float4" + } + }, + { + "name": "avg_width", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats" + }, + "type": { + "name": "int4" + } + }, + { + "name": "n_distinct", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats" + }, + "type": { + "name": "float4" + } + }, + { + "name": "most_common_vals", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats" + }, + "type": { + "name": "anyarray" + } + }, + { + "name": "most_common_freqs", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats" + }, + "type": { + "name": "_float4" + } + }, + { + "name": "histogram_bounds", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats" + }, + "type": { + "name": "anyarray" + } + }, + { + "name": "correlation", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats" + }, + "type": { + "name": "float4" + } + }, + { + "name": "most_common_elems", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats" + }, + "type": { + "name": "anyarray" + } + }, + { + "name": "most_common_elem_freqs", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats" + }, + "type": { + "name": "_float4" + } + }, + { + "name": "elem_count_histogram", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats" + }, + "type": { + "name": "_float4" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext" + }, + "columns": [ + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext" + }, + "type": { + "name": "name" + } + }, + { + "name": "tablename", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext" + }, + "type": { + "name": "name" + } + }, + { + "name": "statistics_schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext" + }, + "type": { + "name": "name" + } + }, + { + "name": "statistics_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext" + }, + "type": { + "name": "name" + } + }, + { + "name": "statistics_owner", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext" + }, + "type": { + "name": "name" + } + }, + { + "name": "attnames", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext" + }, + "type": { + "name": "_name" + } + }, + { + "name": "exprs", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext" + }, + "type": { + "name": "_text" + } + }, + { + "name": "kinds", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext" + }, + "type": { + "name": "_char" + } + }, + { + "name": "inherited", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext" + }, + "type": { + "name": "bool" + } + }, + { + "name": "n_distinct", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext" + }, + "type": { + "name": "pg_ndistinct" + } + }, + { + "name": "dependencies", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext" + }, + "type": { + "name": "pg_dependencies" + } + }, + { + "name": "most_common_vals", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext" + }, + "type": { + "name": "_text" + } + }, + { + "name": "most_common_val_nulls", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext" + }, + "type": { + "name": "_bool" + } + }, + { + "name": "most_common_freqs", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext" + }, + "type": { + "name": "_float8" + } + }, + { + "name": "most_common_base_freqs", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext" + }, + "type": { + "name": "_float8" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext_exprs" + }, + "columns": [ + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext_exprs" + }, + "type": { + "name": "name" + } + }, + { + "name": "tablename", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext_exprs" + }, + "type": { + "name": "name" + } + }, + { + "name": "statistics_schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext_exprs" + }, + "type": { + "name": "name" + } + }, + { + "name": "statistics_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext_exprs" + }, + "type": { + "name": "name" + } + }, + { + "name": "statistics_owner", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext_exprs" + }, + "type": { + "name": "name" + } + }, + { + "name": "expr", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext_exprs" + }, + "type": { + "name": "text" + } + }, + { + "name": "inherited", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext_exprs" + }, + "type": { + "name": "bool" + } + }, + { + "name": "null_frac", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext_exprs" + }, + "type": { + "name": "float4" + } + }, + { + "name": "avg_width", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext_exprs" + }, + "type": { + "name": "int4" + } + }, + { + "name": "n_distinct", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext_exprs" + }, + "type": { + "name": "float4" + } + }, + { + "name": "most_common_vals", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext_exprs" + }, + "type": { + "name": "anyarray" + } + }, + { + "name": "most_common_freqs", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext_exprs" + }, + "type": { + "name": "_float4" + } + }, + { + "name": "histogram_bounds", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext_exprs" + }, + "type": { + "name": "anyarray" + } + }, + { + "name": "correlation", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext_exprs" + }, + "type": { + "name": "float4" + } + }, + { + "name": "most_common_elems", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext_exprs" + }, + "type": { + "name": "anyarray" + } + }, + { + "name": "most_common_elem_freqs", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext_exprs" + }, + "type": { + "name": "_float4" + } + }, + { + "name": "elem_count_histogram", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_stats_ext_exprs" + }, + "type": { + "name": "_float4" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "oid" + } + }, + { + "name": "subdbid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "oid" + } + }, + { + "name": "subskiplsn", + "notNull": true, + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "pg_lsn" + } + }, + { + "name": "subname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "name" + } + }, + { + "name": "subowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "oid" + } + }, + { + "name": "subenabled", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "bool" + } + }, + { + "name": "subbinary", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "bool" + } + }, + { + "name": "substream", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "bool" + } + }, + { + "name": "subtwophasestate", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "char" + } + }, + { + "name": "subdisableonerr", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "bool" + } + }, + { + "name": "subconninfo", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "text" + } + }, + { + "name": "subslotname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "name" + } + }, + { + "name": "subsynccommit", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "text" + } + }, + { + "name": "subpublications", + "notNull": true, + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription" + }, + "type": { + "name": "_text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription_rel" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription_rel" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription_rel" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription_rel" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription_rel" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription_rel" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription_rel" + }, + "type": { + "name": "tid" + } + }, + { + "name": "srsubid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription_rel" + }, + "type": { + "name": "oid" + } + }, + { + "name": "srrelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription_rel" + }, + "type": { + "name": "oid" + } + }, + { + "name": "srsubstate", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription_rel" + }, + "type": { + "name": "char" + } + }, + { + "name": "srsublsn", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_subscription_rel" + }, + "type": { + "name": "pg_lsn" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tables" + }, + "columns": [ + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "tablename", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "tableowner", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "tablespace", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tables" + }, + "type": { + "name": "name" + } + }, + { + "name": "hasindexes", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tables" + }, + "type": { + "name": "bool" + } + }, + { + "name": "hasrules", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tables" + }, + "type": { + "name": "bool" + } + }, + { + "name": "hastriggers", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tables" + }, + "type": { + "name": "bool" + } + }, + { + "name": "rowsecurity", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tables" + }, + "type": { + "name": "bool" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tablespace" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tablespace" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tablespace" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tablespace" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tablespace" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tablespace" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tablespace" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tablespace" + }, + "type": { + "name": "oid" + } + }, + { + "name": "spcname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tablespace" + }, + "type": { + "name": "name" + } + }, + { + "name": "spcowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tablespace" + }, + "type": { + "name": "oid" + } + }, + { + "name": "spcacl", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tablespace" + }, + "type": { + "name": "_aclitem" + } + }, + { + "name": "spcoptions", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_tablespace" + }, + "type": { + "name": "_text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_timezone_abbrevs" + }, + "columns": [ + { + "name": "abbrev", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_timezone_abbrevs" + }, + "type": { + "name": "text" + } + }, + { + "name": "utc_offset", + "length": 16, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_timezone_abbrevs" + }, + "type": { + "name": "interval" + } + }, + { + "name": "is_dst", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_timezone_abbrevs" + }, + "type": { + "name": "bool" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_timezone_names" + }, + "columns": [ + { + "name": "name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_timezone_names" + }, + "type": { + "name": "text" + } + }, + { + "name": "abbrev", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_timezone_names" + }, + "type": { + "name": "text" + } + }, + { + "name": "utc_offset", + "length": 16, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_timezone_names" + }, + "type": { + "name": "interval" + } + }, + { + "name": "is_dst", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_timezone_names" + }, + "type": { + "name": "bool" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_transform" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_transform" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_transform" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_transform" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_transform" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_transform" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_transform" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_transform" + }, + "type": { + "name": "oid" + } + }, + { + "name": "trftype", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_transform" + }, + "type": { + "name": "oid" + } + }, + { + "name": "trflang", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_transform" + }, + "type": { + "name": "oid" + } + }, + { + "name": "trffromsql", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_transform" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "trftosql", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_transform" + }, + "type": { + "name": "regproc" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "oid" + } + }, + { + "name": "tgrelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "oid" + } + }, + { + "name": "tgparentid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "oid" + } + }, + { + "name": "tgname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "name" + } + }, + { + "name": "tgfoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "oid" + } + }, + { + "name": "tgtype", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "int2" + } + }, + { + "name": "tgenabled", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "char" + } + }, + { + "name": "tgisinternal", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "bool" + } + }, + { + "name": "tgconstrrelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "oid" + } + }, + { + "name": "tgconstrindid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "oid" + } + }, + { + "name": "tgconstraint", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "oid" + } + }, + { + "name": "tgdeferrable", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "bool" + } + }, + { + "name": "tginitdeferred", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "bool" + } + }, + { + "name": "tgnargs", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "int2" + } + }, + { + "name": "tgattr", + "notNull": true, + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "int2vector" + } + }, + { + "name": "tgargs", + "notNull": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "bytea" + } + }, + { + "name": "tgqual", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "pg_node_tree" + } + }, + { + "name": "tgoldtable", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "name" + } + }, + { + "name": "tgnewtable", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_trigger" + }, + "type": { + "name": "name" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cfgname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config" + }, + "type": { + "name": "name" + } + }, + { + "name": "cfgnamespace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cfgowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cfgparser", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config" + }, + "type": { + "name": "oid" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config_map" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config_map" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config_map" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config_map" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config_map" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config_map" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config_map" + }, + "type": { + "name": "tid" + } + }, + { + "name": "mapcfg", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config_map" + }, + "type": { + "name": "oid" + } + }, + { + "name": "maptokentype", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config_map" + }, + "type": { + "name": "int4" + } + }, + { + "name": "mapseqno", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config_map" + }, + "type": { + "name": "int4" + } + }, + { + "name": "mapdict", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_config_map" + }, + "type": { + "name": "oid" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_dict" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_dict" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_dict" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_dict" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_dict" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_dict" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_dict" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_dict" + }, + "type": { + "name": "oid" + } + }, + { + "name": "dictname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_dict" + }, + "type": { + "name": "name" + } + }, + { + "name": "dictnamespace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_dict" + }, + "type": { + "name": "oid" + } + }, + { + "name": "dictowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_dict" + }, + "type": { + "name": "oid" + } + }, + { + "name": "dicttemplate", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_dict" + }, + "type": { + "name": "oid" + } + }, + { + "name": "dictinitoption", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_dict" + }, + "type": { + "name": "text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_parser" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_parser" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_parser" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_parser" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_parser" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_parser" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_parser" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_parser" + }, + "type": { + "name": "oid" + } + }, + { + "name": "prsname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_parser" + }, + "type": { + "name": "name" + } + }, + { + "name": "prsnamespace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_parser" + }, + "type": { + "name": "oid" + } + }, + { + "name": "prsstart", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_parser" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "prstoken", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_parser" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "prsend", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_parser" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "prsheadline", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_parser" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "prslextype", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_parser" + }, + "type": { + "name": "regproc" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_template" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_template" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_template" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_template" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_template" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_template" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_template" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_template" + }, + "type": { + "name": "oid" + } + }, + { + "name": "tmplname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_template" + }, + "type": { + "name": "name" + } + }, + { + "name": "tmplnamespace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_template" + }, + "type": { + "name": "oid" + } + }, + { + "name": "tmplinit", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_template" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "tmpllexize", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_ts_template" + }, + "type": { + "name": "regproc" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "oid" + } + }, + { + "name": "typname", + "notNull": true, + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "name" + } + }, + { + "name": "typnamespace", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "oid" + } + }, + { + "name": "typowner", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "oid" + } + }, + { + "name": "typlen", + "notNull": true, + "length": 2, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "int2" + } + }, + { + "name": "typbyval", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "bool" + } + }, + { + "name": "typtype", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "char" + } + }, + { + "name": "typcategory", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "char" + } + }, + { + "name": "typispreferred", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "bool" + } + }, + { + "name": "typisdefined", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "bool" + } + }, + { + "name": "typdelim", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "char" + } + }, + { + "name": "typrelid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "oid" + } + }, + { + "name": "typsubscript", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "typelem", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "oid" + } + }, + { + "name": "typarray", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "oid" + } + }, + { + "name": "typinput", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "typoutput", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "typreceive", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "typsend", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "typmodin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "typmodout", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "typanalyze", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "regproc" + } + }, + { + "name": "typalign", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "char" + } + }, + { + "name": "typstorage", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "char" + } + }, + { + "name": "typnotnull", + "notNull": true, + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "bool" + } + }, + { + "name": "typbasetype", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "oid" + } + }, + { + "name": "typtypmod", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "int4" + } + }, + { + "name": "typndims", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "int4" + } + }, + { + "name": "typcollation", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "oid" + } + }, + { + "name": "typdefaultbin", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "pg_node_tree" + } + }, + { + "name": "typdefault", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "text" + } + }, + { + "name": "typacl", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_type" + }, + "type": { + "name": "_aclitem" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user" + }, + "columns": [ + { + "name": "usename", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user" + }, + "type": { + "name": "name" + } + }, + { + "name": "usesysid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user" + }, + "type": { + "name": "oid" + } + }, + { + "name": "usecreatedb", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user" + }, + "type": { + "name": "bool" + } + }, + { + "name": "usesuper", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user" + }, + "type": { + "name": "bool" + } + }, + { + "name": "userepl", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user" + }, + "type": { + "name": "bool" + } + }, + { + "name": "usebypassrls", + "length": 1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user" + }, + "type": { + "name": "bool" + } + }, + { + "name": "passwd", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user" + }, + "type": { + "name": "text" + } + }, + { + "name": "valuntil", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user" + }, + "type": { + "name": "timestamptz" + } + }, + { + "name": "useconfig", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user" + }, + "type": { + "name": "_text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user_mapping" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user_mapping" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user_mapping" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user_mapping" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user_mapping" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user_mapping" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user_mapping" + }, + "type": { + "name": "tid" + } + }, + { + "name": "oid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user_mapping" + }, + "type": { + "name": "oid" + } + }, + { + "name": "umuser", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user_mapping" + }, + "type": { + "name": "oid" + } + }, + { + "name": "umserver", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user_mapping" + }, + "type": { + "name": "oid" + } + }, + { + "name": "umoptions", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user_mapping" + }, + "type": { + "name": "_text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user_mappings" + }, + "columns": [ + { + "name": "umid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user_mappings" + }, + "type": { + "name": "oid" + } + }, + { + "name": "srvid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user_mappings" + }, + "type": { + "name": "oid" + } + }, + { + "name": "srvname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user_mappings" + }, + "type": { + "name": "name" + } + }, + { + "name": "umuser", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user_mappings" + }, + "type": { + "name": "oid" + } + }, + { + "name": "usename", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user_mappings" + }, + "type": { + "name": "name" + } + }, + { + "name": "umoptions", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_user_mappings" + }, + "type": { + "name": "_text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_views" + }, + "columns": [ + { + "name": "schemaname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_views" + }, + "type": { + "name": "name" + } + }, + { + "name": "viewname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_views" + }, + "type": { + "name": "name" + } + }, + { + "name": "viewowner", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_views" + }, + "type": { + "name": "name" + } + }, + { + "name": "definition", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "pg_catalog", + "name": "pg_views" + }, + "type": { + "name": "text" + } + } + ] + } + ] + }, + { + "name": "information_schema", + "tables": [ + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_data_wrappers" + }, + "columns": [ + { + "name": "oid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_data_wrappers" + }, + "type": { + "name": "oid" + } + }, + { + "name": "fdwowner", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_data_wrappers" + }, + "type": { + "name": "oid" + } + }, + { + "name": "fdwoptions", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_data_wrappers" + }, + "type": { + "name": "_text" + } + }, + { + "name": "foreign_data_wrapper_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_data_wrappers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_data_wrapper_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_data_wrappers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "authorization_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_data_wrappers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_data_wrapper_language", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_data_wrappers" + }, + "type": { + "name": "character_data" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_servers" + }, + "columns": [ + { + "name": "oid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_servers" + }, + "type": { + "name": "oid" + } + }, + { + "name": "srvoptions", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_servers" + }, + "type": { + "name": "_text" + } + }, + { + "name": "foreign_server_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_servers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_server_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_servers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_data_wrapper_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_servers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_data_wrapper_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_servers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_server_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_servers" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "foreign_server_version", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_servers" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "authorization_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_servers" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_table_columns" + }, + "columns": [ + { + "name": "nspname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_table_columns" + }, + "type": { + "name": "name" + } + }, + { + "name": "relname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_table_columns" + }, + "type": { + "name": "name" + } + }, + { + "name": "attname", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_table_columns" + }, + "type": { + "name": "name" + } + }, + { + "name": "attfdwoptions", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_table_columns" + }, + "type": { + "name": "_text" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_tables" + }, + "columns": [ + { + "name": "foreign_table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_tables" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_tables" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_tables" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "ftoptions", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_tables" + }, + "type": { + "name": "_text" + } + }, + { + "name": "foreign_server_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_tables" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_server_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_tables" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "authorization_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_foreign_tables" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_user_mappings" + }, + "columns": [ + { + "name": "oid", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_user_mappings" + }, + "type": { + "name": "oid" + } + }, + { + "name": "umoptions", + "isArray": true, + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_user_mappings" + }, + "type": { + "name": "_text" + } + }, + { + "name": "umuser", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_user_mappings" + }, + "type": { + "name": "oid" + } + }, + { + "name": "authorization_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_user_mappings" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_server_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_user_mappings" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_server_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_user_mappings" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "srvowner", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "_pg_user_mappings" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "administrable_role_authorizations" + }, + "columns": [ + { + "name": "grantee", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "administrable_role_authorizations" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "role_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "administrable_role_authorizations" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "is_grantable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "administrable_role_authorizations" + }, + "type": { + "name": "yes_or_no" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "applicable_roles" + }, + "columns": [ + { + "name": "grantee", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "applicable_roles" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "role_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "applicable_roles" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "is_grantable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "applicable_roles" + }, + "type": { + "name": "yes_or_no" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "columns": [ + { + "name": "udt_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "attribute_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "ordinal_position", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "attribute_default", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_nullable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "data_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "character_maximum_length", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "character_octet_length", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "character_set_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "numeric_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "numeric_precision_radix", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "numeric_scale", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "datetime_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "interval_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "interval_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "attribute_udt_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "attribute_udt_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "attribute_udt_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "scope_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "scope_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "scope_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "maximum_cardinality", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "dtd_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "is_derived_reference_attribute", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "attributes" + }, + "type": { + "name": "yes_or_no" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "character_sets" + }, + "columns": [ + { + "name": "character_set_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "character_sets" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "character_sets" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "character_sets" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_repertoire", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "character_sets" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "form_of_use", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "character_sets" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "default_collate_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "character_sets" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "default_collate_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "character_sets" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "default_collate_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "character_sets" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "check_constraint_routine_usage" + }, + "columns": [ + { + "name": "constraint_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "check_constraint_routine_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "check_constraint_routine_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "check_constraint_routine_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "check_constraint_routine_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "check_constraint_routine_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "check_constraint_routine_usage" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "check_constraints" + }, + "columns": [ + { + "name": "constraint_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "check_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "check_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "check_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "check_clause", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "check_constraints" + }, + "type": { + "name": "character_data" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "collation_character_set_applicability" + }, + "columns": [ + { + "name": "collation_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "collation_character_set_applicability" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "collation_character_set_applicability" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "collation_character_set_applicability" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "collation_character_set_applicability" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "collation_character_set_applicability" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "collation_character_set_applicability" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "collations" + }, + "columns": [ + { + "name": "collation_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "collations" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "collations" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "collations" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "pad_attribute", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "collations" + }, + "type": { + "name": "character_data" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_column_usage" + }, + "columns": [ + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "column_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "dependent_column", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_column_usage" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_domain_usage" + }, + "columns": [ + { + "name": "domain_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_domain_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "domain_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_domain_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "domain_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_domain_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_domain_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_domain_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_domain_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "column_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_domain_usage" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_options" + }, + "columns": [ + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "column_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "option_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "option_value", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_options" + }, + "type": { + "name": "character_data" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_privileges" + }, + "columns": [ + { + "name": "grantor", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "grantee", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "column_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "privilege_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_privileges" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_grantable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_privileges" + }, + "type": { + "name": "yes_or_no" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_udt_usage" + }, + "columns": [ + { + "name": "udt_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_udt_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_udt_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_udt_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_udt_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_udt_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_udt_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "column_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "column_udt_usage" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "columns": [ + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "column_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "ordinal_position", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "column_default", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_nullable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "data_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "character_maximum_length", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "character_octet_length", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "numeric_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "numeric_precision_radix", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "numeric_scale", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "datetime_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "interval_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "interval_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "character_set_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "domain_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "domain_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "domain_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "scope_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "scope_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "scope_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "maximum_cardinality", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "dtd_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "is_self_referencing", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "is_identity", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "identity_generation", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "identity_start", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "identity_increment", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "identity_maximum", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "identity_minimum", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "identity_cycle", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "is_generated", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "generation_expression", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_updatable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "columns" + }, + "type": { + "name": "yes_or_no" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "constraint_column_usage" + }, + "columns": [ + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "constraint_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "constraint_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "constraint_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "column_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "constraint_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "constraint_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "constraint_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "constraint_column_usage" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "constraint_table_usage" + }, + "columns": [ + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "constraint_table_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "constraint_table_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "constraint_table_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "constraint_table_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "constraint_table_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "constraint_table_usage" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "data_type_privileges" + }, + "columns": [ + { + "name": "object_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "data_type_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "object_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "data_type_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "object_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "data_type_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "object_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "data_type_privileges" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "dtd_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "data_type_privileges" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domain_constraints" + }, + "columns": [ + { + "name": "constraint_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domain_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domain_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domain_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "domain_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domain_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "domain_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domain_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "domain_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domain_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "is_deferrable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domain_constraints" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "initially_deferred", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domain_constraints" + }, + "type": { + "name": "yes_or_no" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domain_udt_usage" + }, + "columns": [ + { + "name": "udt_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domain_udt_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domain_udt_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domain_udt_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "domain_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domain_udt_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "domain_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domain_udt_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "domain_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domain_udt_usage" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "columns": [ + { + "name": "domain_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "domain_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "domain_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "data_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "character_maximum_length", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "character_octet_length", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "character_set_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "numeric_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "numeric_precision_radix", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "numeric_scale", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "datetime_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "interval_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "interval_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "domain_default", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "udt_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "scope_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "scope_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "scope_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "maximum_cardinality", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "dtd_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "domains" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "columns": [ + { + "name": "object_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "object_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "object_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "object_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "collection_type_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "data_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "character_maximum_length", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "character_octet_length", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "character_set_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "numeric_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "numeric_precision_radix", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "numeric_scale", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "datetime_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "interval_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "interval_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "domain_default", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "udt_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "scope_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "scope_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "scope_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "maximum_cardinality", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "dtd_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "element_types" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "enabled_roles" + }, + "columns": [ + { + "name": "role_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "enabled_roles" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_data_wrapper_options" + }, + "columns": [ + { + "name": "foreign_data_wrapper_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_data_wrapper_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_data_wrapper_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_data_wrapper_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "option_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_data_wrapper_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "option_value", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_data_wrapper_options" + }, + "type": { + "name": "character_data" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_data_wrappers" + }, + "columns": [ + { + "name": "foreign_data_wrapper_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_data_wrappers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_data_wrapper_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_data_wrappers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "authorization_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_data_wrappers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "library_name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_data_wrappers" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "foreign_data_wrapper_language", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_data_wrappers" + }, + "type": { + "name": "character_data" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_server_options" + }, + "columns": [ + { + "name": "foreign_server_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_server_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_server_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_server_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "option_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_server_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "option_value", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_server_options" + }, + "type": { + "name": "character_data" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_servers" + }, + "columns": [ + { + "name": "foreign_server_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_servers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_server_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_servers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_data_wrapper_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_servers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_data_wrapper_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_servers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_server_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_servers" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "foreign_server_version", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_servers" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "authorization_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_servers" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_table_options" + }, + "columns": [ + { + "name": "foreign_table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_table_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_table_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_table_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "option_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_table_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "option_value", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_table_options" + }, + "type": { + "name": "character_data" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_tables" + }, + "columns": [ + { + "name": "foreign_table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_tables" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_tables" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_tables" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_server_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_tables" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_server_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "foreign_tables" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "information_schema_catalog_name" + }, + "columns": [ + { + "name": "catalog_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "information_schema_catalog_name" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "key_column_usage" + }, + "columns": [ + { + "name": "constraint_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "key_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "key_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "key_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "key_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "key_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "key_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "column_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "key_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "ordinal_position", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "key_column_usage" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "position_in_unique_constraint", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "key_column_usage" + }, + "type": { + "name": "cardinal_number" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "columns": [ + { + "name": "specific_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "ordinal_position", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "parameter_mode", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_result", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "as_locator", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "parameter_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "data_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "character_maximum_length", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "character_octet_length", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "character_set_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "numeric_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "numeric_precision_radix", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "numeric_scale", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "datetime_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "interval_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "interval_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "udt_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "scope_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "scope_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "scope_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "maximum_cardinality", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "dtd_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "parameter_default", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "parameters" + }, + "type": { + "name": "character_data" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "referential_constraints" + }, + "columns": [ + { + "name": "constraint_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "referential_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "referential_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "referential_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "unique_constraint_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "referential_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "unique_constraint_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "referential_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "unique_constraint_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "referential_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "match_option", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "referential_constraints" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "update_rule", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "referential_constraints" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "delete_rule", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "referential_constraints" + }, + "type": { + "name": "character_data" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_column_grants" + }, + "columns": [ + { + "name": "grantor", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_column_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "grantee", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_column_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_column_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_column_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_column_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "column_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_column_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "privilege_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_column_grants" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_grantable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_column_grants" + }, + "type": { + "name": "yes_or_no" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_routine_grants" + }, + "columns": [ + { + "name": "grantor", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_routine_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "grantee", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_routine_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_routine_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_routine_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_routine_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_routine_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_routine_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_routine_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "privilege_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_routine_grants" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_grantable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_routine_grants" + }, + "type": { + "name": "yes_or_no" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_table_grants" + }, + "columns": [ + { + "name": "grantor", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_table_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "grantee", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_table_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_table_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_table_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_table_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "privilege_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_table_grants" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_grantable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_table_grants" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "with_hierarchy", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_table_grants" + }, + "type": { + "name": "yes_or_no" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_udt_grants" + }, + "columns": [ + { + "name": "grantor", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_udt_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "grantee", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_udt_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_udt_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_udt_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_udt_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "privilege_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_udt_grants" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_grantable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_udt_grants" + }, + "type": { + "name": "yes_or_no" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_usage_grants" + }, + "columns": [ + { + "name": "grantor", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_usage_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "grantee", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_usage_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "object_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_usage_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "object_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_usage_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "object_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_usage_grants" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "object_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_usage_grants" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "privilege_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_usage_grants" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_grantable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "role_usage_grants" + }, + "type": { + "name": "yes_or_no" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_column_usage" + }, + "columns": [ + { + "name": "specific_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "column_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_column_usage" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_privileges" + }, + "columns": [ + { + "name": "grantor", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "grantee", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "privilege_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_privileges" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_grantable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_privileges" + }, + "type": { + "name": "yes_or_no" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_routine_usage" + }, + "columns": [ + { + "name": "specific_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_routine_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_routine_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_routine_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_routine_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_routine_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_routine_usage" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_sequence_usage" + }, + "columns": [ + { + "name": "specific_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_sequence_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_sequence_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_sequence_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_sequence_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_sequence_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_sequence_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "sequence_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_sequence_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "sequence_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_sequence_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "sequence_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_sequence_usage" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_table_usage" + }, + "columns": [ + { + "name": "specific_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_table_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_table_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_table_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_table_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_table_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_table_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_table_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_table_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routine_table_usage" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "columns": [ + { + "name": "specific_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "module_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "module_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "module_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "data_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "character_maximum_length", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "character_octet_length", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "character_set_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "numeric_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "numeric_precision_radix", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "numeric_scale", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "datetime_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "interval_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "interval_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "type_udt_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "type_udt_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "type_udt_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "scope_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "scope_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "scope_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "maximum_cardinality", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "dtd_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "routine_body", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "routine_definition", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "external_name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "external_language", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "parameter_style", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_deterministic", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "sql_data_access", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_null_call", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "sql_path", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "schema_level_routine", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "max_dynamic_result_sets", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "is_user_defined_cast", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "is_implicitly_invocable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "security_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "to_sql_specific_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "to_sql_specific_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "to_sql_specific_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "as_locator", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "created", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "time_stamp" + } + }, + { + "name": "last_altered", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "time_stamp" + } + }, + { + "name": "new_savepoint_level", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "is_udt_dependent", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "result_cast_from_data_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "result_cast_as_locator", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "result_cast_char_max_length", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "result_cast_char_octet_length", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "result_cast_char_set_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "result_cast_char_set_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "result_cast_char_set_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "result_cast_collation_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "result_cast_collation_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "result_cast_collation_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "result_cast_numeric_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "result_cast_numeric_precision_radix", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "result_cast_numeric_scale", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "result_cast_datetime_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "result_cast_interval_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "result_cast_interval_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "result_cast_type_udt_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "result_cast_type_udt_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "result_cast_type_udt_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "result_cast_scope_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "result_cast_scope_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "result_cast_scope_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "result_cast_maximum_cardinality", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "result_cast_dtd_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "routines" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "schemata" + }, + "columns": [ + { + "name": "catalog_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "schemata" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "schema_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "schemata" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "schema_owner", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "schemata" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "default_character_set_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "schemata" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "default_character_set_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "schemata" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "default_character_set_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "schemata" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "sql_path", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "schemata" + }, + "type": { + "name": "character_data" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sequences" + }, + "columns": [ + { + "name": "sequence_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sequences" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "sequence_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sequences" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "sequence_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sequences" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "data_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sequences" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "numeric_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sequences" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "numeric_precision_radix", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sequences" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "numeric_scale", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sequences" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "start_value", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sequences" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "minimum_value", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sequences" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "maximum_value", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sequences" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "increment", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sequences" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "cycle_option", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sequences" + }, + "type": { + "name": "yes_or_no" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_features" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_features" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_features" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_features" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_features" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_features" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_features" + }, + "type": { + "name": "tid" + } + }, + { + "name": "feature_id", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_features" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "feature_name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_features" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "sub_feature_id", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_features" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "sub_feature_name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_features" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_supported", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_features" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "is_verified_by", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_features" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "comments", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_features" + }, + "type": { + "name": "character_data" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_implementation_info" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_implementation_info" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_implementation_info" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_implementation_info" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_implementation_info" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_implementation_info" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_implementation_info" + }, + "type": { + "name": "tid" + } + }, + { + "name": "implementation_info_id", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_implementation_info" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "implementation_info_name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_implementation_info" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "integer_value", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_implementation_info" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "character_value", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_implementation_info" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "comments", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_implementation_info" + }, + "type": { + "name": "character_data" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_parts" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_parts" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_parts" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_parts" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_parts" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_parts" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_parts" + }, + "type": { + "name": "tid" + } + }, + { + "name": "feature_id", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_parts" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "feature_name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_parts" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_supported", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_parts" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "is_verified_by", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_parts" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "comments", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_parts" + }, + "type": { + "name": "character_data" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_sizing" + }, + "columns": [ + { + "name": "tableoid", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_sizing" + }, + "type": { + "name": "oid" + } + }, + { + "name": "cmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_sizing" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmax", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_sizing" + }, + "type": { + "name": "xid" + } + }, + { + "name": "cmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_sizing" + }, + "type": { + "name": "cid" + } + }, + { + "name": "xmin", + "notNull": true, + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_sizing" + }, + "type": { + "name": "xid" + } + }, + { + "name": "ctid", + "notNull": true, + "length": 6, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_sizing" + }, + "type": { + "name": "tid" + } + }, + { + "name": "sizing_id", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_sizing" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "sizing_name", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_sizing" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "supported_value", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_sizing" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "comments", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "sql_sizing" + }, + "type": { + "name": "character_data" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_constraints" + }, + "columns": [ + { + "name": "constraint_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_constraints" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "constraint_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_constraints" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_deferrable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_constraints" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "initially_deferred", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_constraints" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "enforced", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_constraints" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "nulls_distinct", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_constraints" + }, + "type": { + "name": "yes_or_no" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_privileges" + }, + "columns": [ + { + "name": "grantor", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "grantee", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "privilege_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_privileges" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_grantable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_privileges" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "with_hierarchy", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "table_privileges" + }, + "type": { + "name": "yes_or_no" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "tables" + }, + "columns": [ + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "tables" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "tables" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "tables" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "tables" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "self_referencing_column_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "tables" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "reference_generation", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "tables" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "user_defined_type_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "tables" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "user_defined_type_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "tables" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "user_defined_type_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "tables" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "is_insertable_into", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "tables" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "is_typed", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "tables" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "commit_action", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "tables" + }, + "type": { + "name": "character_data" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "transforms" + }, + "columns": [ + { + "name": "udt_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "transforms" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "transforms" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "transforms" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "transforms" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "transforms" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "transforms" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "group_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "transforms" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "transform_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "transforms" + }, + "type": { + "name": "character_data" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggered_update_columns" + }, + "columns": [ + { + "name": "trigger_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggered_update_columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "trigger_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggered_update_columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "trigger_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggered_update_columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "event_object_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggered_update_columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "event_object_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggered_update_columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "event_object_table", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggered_update_columns" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "event_object_column", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggered_update_columns" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggers" + }, + "columns": [ + { + "name": "trigger_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "trigger_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "trigger_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "event_manipulation", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggers" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "event_object_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "event_object_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "event_object_table", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "action_order", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggers" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "action_condition", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggers" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "action_statement", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggers" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "action_orientation", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggers" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "action_timing", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggers" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "action_reference_old_table", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "action_reference_new_table", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "action_reference_old_row", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "action_reference_new_row", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggers" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "created", + "length": 8, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "triggers" + }, + "type": { + "name": "time_stamp" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "udt_privileges" + }, + "columns": [ + { + "name": "grantor", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "udt_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "grantee", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "udt_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "udt_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "udt_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "udt_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "udt_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "privilege_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "udt_privileges" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_grantable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "udt_privileges" + }, + "type": { + "name": "yes_or_no" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "usage_privileges" + }, + "columns": [ + { + "name": "grantor", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "usage_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "grantee", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "usage_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "object_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "usage_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "object_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "usage_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "object_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "usage_privileges" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "object_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "usage_privileges" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "privilege_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "usage_privileges" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_grantable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "usage_privileges" + }, + "type": { + "name": "yes_or_no" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "columns": [ + { + "name": "user_defined_type_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "user_defined_type_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "user_defined_type_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "user_defined_type_category", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_instantiable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "is_final", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "ordering_form", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "ordering_category", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "ordering_routine_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "ordering_routine_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "ordering_routine_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "reference_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "data_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "character_maximum_length", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "character_octet_length", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "character_set_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "character_set_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "collation_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "numeric_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "numeric_precision_radix", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "numeric_scale", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "datetime_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "interval_type", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "interval_precision", + "length": 4, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "cardinal_number" + } + }, + { + "name": "source_dtd_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "ref_dtd_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_defined_types" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_mapping_options" + }, + "columns": [ + { + "name": "authorization_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_mapping_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_server_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_mapping_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_server_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_mapping_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "option_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_mapping_options" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "option_value", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_mapping_options" + }, + "type": { + "name": "character_data" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_mappings" + }, + "columns": [ + { + "name": "authorization_identifier", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_mappings" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_server_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_mappings" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "foreign_server_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "user_mappings" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_column_usage" + }, + "columns": [ + { + "name": "view_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "view_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "view_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_column_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "column_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_column_usage" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_routine_usage" + }, + "columns": [ + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_routine_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_routine_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_routine_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_routine_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_routine_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "specific_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_routine_usage" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_table_usage" + }, + "columns": [ + { + "name": "view_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_table_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "view_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_table_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "view_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_table_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_table_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_table_usage" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "view_table_usage" + }, + "type": { + "name": "sql_identifier" + } + } + ] + }, + { + "rel": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "views" + }, + "columns": [ + { + "name": "table_catalog", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "views" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_schema", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "views" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "table_name", + "length": 64, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "views" + }, + "type": { + "name": "sql_identifier" + } + }, + { + "name": "view_definition", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "views" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "check_option", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "views" + }, + "type": { + "name": "character_data" + } + }, + { + "name": "is_updatable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "views" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "is_insertable_into", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "views" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "is_trigger_updatable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "views" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "is_trigger_deletable", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "views" + }, + "type": { + "name": "yes_or_no" + } + }, + { + "name": "is_trigger_insertable_into", + "length": -1, + "table": { + "catalog": "pg_catalog", + "schema": "information_schema", + "name": "views" + }, + "type": { + "name": "yes_or_no" + } + } + ] + } + ] + }, + { + "name": "sales", + "tables": [ + { + "rel": { + "schema": "sales", + "name": "customers" + }, + "columns": [ + { + "name": "customer_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "serial" + } + }, + { + "name": "name", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "schema": "pg_catalog", + "name": "varchar" + } + }, + { + "name": "email", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "schema": "pg_catalog", + "name": "varchar" + } + }, + { + "name": "phone", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "schema": "pg_catalog", + "name": "varchar" + } + }, + { + "name": "address", + "length": -1, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "schema": "pg_catalog", + "name": "varchar" + } + }, + { + "name": "registered_at", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "schema": "pg_catalog", + "name": "timestamp" + } + } + ] + }, + { + "rel": { + "schema": "sales", + "name": "products" + }, + "columns": [ + { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "serial" + } + }, + { + "name": "name", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "schema": "pg_catalog", + "name": "varchar" + } + }, + { + "name": "category", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "schema": "pg_catalog", + "name": "varchar" + } + }, + { + "name": "unit_price", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "schema": "pg_catalog", + "name": "numeric" + } + }, + { + "name": "stock_quantity", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "schema": "pg_catalog", + "name": "int4" + } + }, + { + "name": "description", + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "text" + } + }, + { + "name": "added_at", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "schema": "pg_catalog", + "name": "timestamp" + } + } + ] + }, + { + "rel": { + "schema": "sales", + "name": "orders" + }, + "columns": [ + { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "serial" + } + }, + { + "name": "customer_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "schema": "pg_catalog", + "name": "int4" + } + }, + { + "name": "ordered_at", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "schema": "pg_catalog", + "name": "timestamp" + } + }, + { + "name": "order_state", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "schema": "pg_catalog", + "name": "varchar" + } + }, + { + "name": "total_amount", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "schema": "pg_catalog", + "name": "numeric" + } + } + ] + }, + { + "rel": { + "schema": "sales", + "name": "order_items" + }, + "columns": [ + { + "name": "order_item_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "name": "serial" + } + }, + { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "schema": "pg_catalog", + "name": "int4" + } + }, + { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "schema": "pg_catalog", + "name": "int4" + } + }, + { + "name": "quantity", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "schema": "pg_catalog", + "name": "int4" + } + }, + { + "name": "unit_price", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "schema": "pg_catalog", + "name": "numeric" + } + } + ] + } + ] + } + ] + }, + "queries": [ + { + "text": "SELECT \n o.order_id, ordered_at, order_state, total_amount, order_item_id, i.quantity, i.unit_price, \n p.product_id, p.name as product_name, p.category as product_category\nFROM sales.orders o\nJOIN sales.order_items i\nUSING (order_id)\nJOIN sales.products p\nUSING (product_id)\nWHERE o.customer_id = $1\nORDER BY o.ordered_at DESC\nLIMIT $3 OFFSET $2", + "name": "GetCustomerOrders", + "cmd": ":many", + "columns": [ + { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "serial" + }, + "originalName": "order_id" + }, + { + "name": "ordered_at", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "schema": "pg_catalog", + "name": "timestamp" + }, + "originalName": "ordered_at" + }, + { + "name": "order_state", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "schema": "pg_catalog", + "name": "varchar" + }, + "originalName": "order_state" + }, + { + "name": "total_amount", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "schema": "pg_catalog", + "name": "numeric" + }, + "originalName": "total_amount" + }, + { + "name": "order_item_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "name": "serial" + }, + "originalName": "order_item_id" + }, + { + "name": "quantity", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "schema": "pg_catalog", + "name": "int4" + }, + "originalName": "quantity" + }, + { + "name": "unit_price", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "schema": "pg_catalog", + "name": "numeric" + }, + "originalName": "unit_price" + }, + { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "serial" + }, + "originalName": "product_id" + }, + { + "name": "product_name", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "schema": "pg_catalog", + "name": "varchar" + }, + "originalName": "name" + }, + { + "name": "product_category", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "schema": "pg_catalog", + "name": "varchar" + }, + "originalName": "category" + } + ], + "parameters": [ + { + "number": 1, + "column": { + "name": "customer_id", + "notNull": true, + "length": -1, + "isNamedParam": true, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "pg_catalog.int4" + }, + "originalName": "customer_id" + } + }, + { + "number": 2, + "column": { + "name": "offset", + "notNull": true, + "length": -1, + "isNamedParam": true, + "type": { + "name": "integer" + } + } + }, + { + "number": 3, + "column": { + "name": "limit", + "notNull": true, + "length": -1, + "isNamedParam": true, + "type": { + "name": "integer" + } + } + } + ], + "filename": "query.sql" + }, + { + "text": "INSERT INTO sales.customers (name, email, phone, address, registered_at) VALUES ($1, $2, $3, $4, $5)", + "name": "AddCustomers", + "cmd": ":copyfrom", + "parameters": [ + { + "number": 1, + "column": { + "name": "name", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "pg_catalog.varchar" + }, + "originalName": "name" + } + }, + { + "number": 2, + "column": { + "name": "email", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "pg_catalog.varchar" + }, + "originalName": "email" + } + }, + { + "number": 3, + "column": { + "name": "phone", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "pg_catalog.varchar" + }, + "originalName": "phone" + } + }, + { + "number": 4, + "column": { + "name": "address", + "length": -1, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "pg_catalog.varchar" + }, + "originalName": "address" + } + }, + { + "number": 5, + "column": { + "name": "registered_at", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "pg_catalog.timestamp" + }, + "originalName": "registered_at" + } + } + ], + "filename": "query.sql", + "insert_into_table": { + "schema": "sales", + "name": "customers" + } + }, + { + "text": "INSERT INTO sales.products (name, category, unit_price, stock_quantity, description) VALUES ($1, $2, $3, $4, $5)", + "name": "AddProducts", + "cmd": ":copyfrom", + "parameters": [ + { + "number": 1, + "column": { + "name": "name", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "pg_catalog.varchar" + }, + "originalName": "name" + } + }, + { + "number": 2, + "column": { + "name": "category", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "pg_catalog.varchar" + }, + "originalName": "category" + } + }, + { + "number": 3, + "column": { + "name": "unit_price", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "pg_catalog.numeric" + }, + "originalName": "unit_price" + } + }, + { + "number": 4, + "column": { + "name": "stock_quantity", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "pg_catalog.int4" + }, + "originalName": "stock_quantity" + } + }, + { + "number": 5, + "column": { + "name": "description", + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "text" + }, + "originalName": "description" + } + } + ], + "filename": "query.sql", + "insert_into_table": { + "schema": "sales", + "name": "products" + } + }, + { + "text": "INSERT INTO sales.orders (customer_id, order_state, total_amount) VALUES ($1, $2, $3)", + "name": "AddOrders", + "cmd": ":copyfrom", + "parameters": [ + { + "number": 1, + "column": { + "name": "customer_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "pg_catalog.int4" + }, + "originalName": "customer_id" + } + }, + { + "number": 2, + "column": { + "name": "order_state", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "pg_catalog.varchar" + }, + "originalName": "order_state" + } + }, + { + "number": 3, + "column": { + "name": "total_amount", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "pg_catalog.numeric" + }, + "originalName": "total_amount" + } + } + ], + "filename": "query.sql", + "insert_into_table": { + "schema": "sales", + "name": "orders" + } + }, + { + "text": "INSERT INTO sales.order_items (order_id, product_id, quantity, unit_price) VALUES ($1, $2, $3, $4)", + "name": "AddOrderItems", + "cmd": ":copyfrom", + "parameters": [ + { + "number": 1, + "column": { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "name": "pg_catalog.int4" + }, + "originalName": "order_id" + } + }, + { + "number": 2, + "column": { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "name": "pg_catalog.int4" + }, + "originalName": "product_id" + } + }, + { + "number": 3, + "column": { + "name": "quantity", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "name": "pg_catalog.int4" + }, + "originalName": "quantity" + } + }, + { + "number": 4, + "column": { + "name": "unit_price", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "order_items" + }, + "type": { + "name": "pg_catalog.numeric" + }, + "originalName": "unit_price" + } + } + ], + "filename": "query.sql", + "insert_into_table": { + "schema": "sales", + "name": "order_items" + } + }, + { + "text": "SELECT customer_id FROM sales.customers ORDER BY customer_id LIMIT $1", + "name": "GetCustomerIds", + "cmd": ":many", + "columns": [ + { + "name": "customer_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "customers" + }, + "type": { + "name": "serial" + }, + "originalName": "customer_id" + } + ], + "parameters": [ + { + "number": 1, + "column": { + "name": "limit", + "notNull": true, + "length": -1, + "isNamedParam": true, + "type": { + "name": "integer" + } + } + } + ], + "filename": "query.sql" + }, + { + "text": "SELECT product_id FROM sales.products ORDER BY product_id LIMIT $1", + "name": "GetProductIds", + "cmd": ":many", + "columns": [ + { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "serial" + }, + "originalName": "product_id" + } + ], + "parameters": [ + { + "number": 1, + "column": { + "name": "limit", + "notNull": true, + "length": -1, + "isNamedParam": true, + "type": { + "name": "integer" + } + } + } + ], + "filename": "query.sql" + }, + { + "text": "SELECT COUNT(*) AS cnt FROM sales.order_items", + "name": "GetOrderItemsCount", + "cmd": ":one", + "columns": [ + { + "name": "cnt", + "notNull": true, + "length": -1, + "isFuncCall": true, + "type": { + "name": "bigint" + } + } + ], + "filename": "query.sql" + }, + { + "text": "SELECT order_id FROM sales.orders ORDER BY ordered_at DESC LIMIT $1", + "name": "GetOrderIds", + "cmd": ":many", + "columns": [ + { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "serial" + }, + "originalName": "order_id" + } + ], + "parameters": [ + { + "number": 1, + "column": { + "name": "limit", + "notNull": true, + "length": -1, + "isNamedParam": true, + "type": { + "name": "integer" + } + } + } + ], + "filename": "query.sql" + }, + { + "text": "SELECT order_id, total_amount FROM sales.orders WHERE order_id = ANY($1)", + "name": "GetOrderAmounts", + "cmd": ":many", + "columns": [ + { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "serial" + }, + "originalName": "order_id" + }, + { + "name": "total_amount", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "schema": "pg_catalog", + "name": "numeric" + }, + "originalName": "total_amount" + } + ], + "parameters": [ + { + "number": 1, + "column": { + "name": "order_ids", + "notNull": true, + "length": -1, + "isNamedParam": true, + "table": { + "schema": "sales", + "name": "orders" + }, + "type": { + "name": "serial" + }, + "originalName": "order_id" + } + } + ], + "filename": "query.sql" + }, + { + "text": "SELECT product_id, unit_price FROM sales.products WHERE product_id = ANY($1)", + "name": "GetProductPrices", + "cmd": ":many", + "columns": [ + { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "serial" + }, + "originalName": "product_id" + }, + { + "name": "unit_price", + "notNull": true, + "length": -1, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "schema": "pg_catalog", + "name": "numeric" + }, + "originalName": "unit_price" + } + ], + "parameters": [ + { + "number": 1, + "column": { + "name": "product_ids", + "notNull": true, + "length": -1, + "isNamedParam": true, + "table": { + "schema": "sales", + "name": "products" + }, + "type": { + "name": "serial" + }, + "originalName": "product_id" + } + } + ], + "filename": "query.sql" + } + ], + "sqlc_version": "v1.30.0", + "plugin_options": "eyJvdmVycmlkZURyaXZlclZlcnNpb24iOiIiLCJnZW5lcmF0ZUNzcHJvaiI6dHJ1ZSwidGFyZ2V0RnJhbWV3b3JrIjoibmV0OC4wIiwibmFtZXNwYWNlTmFtZSI6IlBvc3RncmVzU3FsY0ltcGwiLCJ1c2VEYXBwZXIiOmZhbHNlLCJvdmVycmlkZURhcHBlclZlcnNpb24iOiIiLCJvdmVycmlkZXMiOm51bGwsImRlYnVnUmVxdWVzdCI6ZmFsc2UsInVzZUNlbnRyYWxQYWNrYWdlTWFuYWdlbWVudCI6ZmFsc2UsIndpdGhBc3luY1N1ZmZpeCI6dHJ1ZX0=" +} \ No newline at end of file diff --git a/benchmark/PostgresqlSqlcImpl/request.message b/benchmark/PostgresqlSqlcImpl/request.message new file mode 100644 index 00000000..1ab8065a --- /dev/null +++ b/benchmark/PostgresqlSqlcImpl/request.message @@ -0,0 +1,10270 @@ + +è +2 +postgresql/examples/config/postgresql/benchmark/schema.sql".examples/config/postgresql/benchmark/query.sqlbv +benchmark/PostgresqlSqlcImplcsharp8{"debugRequest":true,"namespaceName":"PostgresSqlcImpl"}* +./dist/LocalRunneròÚ public"public" pg_temp"æ² +pg_catalog‰ +& + +pg_catalog +pg_catalog pg_aggregate= +tableoid0R& + +pg_catalog +pg_catalog pg_aggregateboid9 +cmax0R& + +pg_catalog +pg_catalog pg_aggregatebcid9 +xmax0R& + +pg_catalog +pg_catalog pg_aggregatebxid9 +cmin0R& + +pg_catalog +pg_catalog pg_aggregatebcid9 +xmin0R& + +pg_catalog +pg_catalog pg_aggregatebxid9 +ctid0R& + +pg_catalog +pg_catalog pg_aggregatebtidA +aggfnoid0R& + +pg_catalog +pg_catalog pg_aggregateb regproc= +aggkind0R& + +pg_catalog +pg_catalog pg_aggregatebcharF +aggnumdirectargs0R& + +pg_catalog +pg_catalog pg_aggregatebint2C + +aggtransfn0R& + +pg_catalog +pg_catalog pg_aggregateb regprocC + +aggfinalfn0R& + +pg_catalog +pg_catalog pg_aggregateb regprocE + aggcombinefn0R& + +pg_catalog +pg_catalog pg_aggregateb regprocD + aggserialfn0R& + +pg_catalog +pg_catalog pg_aggregateb regprocF + aggdeserialfn0R& + +pg_catalog +pg_catalog pg_aggregateb regprocD + aggmtransfn0R& + +pg_catalog +pg_catalog pg_aggregateb regprocG +aggminvtransfn0R& + +pg_catalog +pg_catalog pg_aggregateb regprocD + aggmfinalfn0R& + +pg_catalog +pg_catalog pg_aggregateb regprocC + aggfinalextra0R& + +pg_catalog +pg_catalog pg_aggregatebboolD +aggmfinalextra0R& + +pg_catalog +pg_catalog pg_aggregatebboolD +aggfinalmodify0R& + +pg_catalog +pg_catalog pg_aggregatebcharE +aggmfinalmodify0R& + +pg_catalog +pg_catalog pg_aggregatebchar> + aggsortop0R& + +pg_catalog +pg_catalog pg_aggregateboidA + aggtranstype0R& + +pg_catalog +pg_catalog pg_aggregateboidC + aggtransspace0R& + +pg_catalog +pg_catalog pg_aggregatebint4B + aggmtranstype0R& + +pg_catalog +pg_catalog pg_aggregateboidD +aggmtransspace0R& + +pg_catalog +pg_catalog pg_aggregatebint4G + +agginitval0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_aggregatebtextH + aggminitval0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_aggregatebtext» + + +pg_catalog +pg_catalogpg_am6 +tableoid0R + +pg_catalog +pg_catalogpg_amboid2 +cmax0R + +pg_catalog +pg_catalogpg_ambcid2 +xmax0R + +pg_catalog +pg_catalogpg_ambxid2 +cmin0R + +pg_catalog +pg_catalogpg_ambcid2 +xmin0R + +pg_catalog +pg_catalogpg_ambxid2 +ctid0R + +pg_catalog +pg_catalogpg_ambtid1 +oid0R + +pg_catalog +pg_catalogpg_amboid5 +amname0@R + +pg_catalog +pg_catalogpg_ambname; + amhandler0R + +pg_catalog +pg_catalogpg_amb regproc5 +amtype0R + +pg_catalog +pg_catalogpg_ambchar‹ +! + +pg_catalog +pg_catalogpg_amop8 +tableoid0R! + +pg_catalog +pg_catalogpg_amopboid4 +cmax0R! + +pg_catalog +pg_catalogpg_amopbcid4 +xmax0R! + +pg_catalog +pg_catalogpg_amopbxid4 +cmin0R! + +pg_catalog +pg_catalogpg_amopbcid4 +xmin0R! + +pg_catalog +pg_catalogpg_amopbxid4 +ctid0R! + +pg_catalog +pg_catalogpg_amopbtid3 +oid0R! + +pg_catalog +pg_catalogpg_amopboid: + +amopfamily0R! + +pg_catalog +pg_catalogpg_amopboid< + amoplefttype0R! + +pg_catalog +pg_catalogpg_amopboid= + amoprighttype0R! + +pg_catalog +pg_catalogpg_amopboid= + amopstrategy0R! + +pg_catalog +pg_catalogpg_amopbint2< + amoppurpose0R! + +pg_catalog +pg_catalogpg_amopbchar7 +amopopr0R! + +pg_catalog +pg_catalogpg_amopboid: + +amopmethod0R! + +pg_catalog +pg_catalogpg_amopboid> +amopsortfamily0R! + +pg_catalog +pg_catalogpg_amopboidñ +# + +pg_catalog +pg_catalog pg_amproc: +tableoid0R# + +pg_catalog +pg_catalog pg_amprocboid6 +cmax0R# + +pg_catalog +pg_catalog pg_amprocbcid6 +xmax0R# + +pg_catalog +pg_catalog pg_amprocbxid6 +cmin0R# + +pg_catalog +pg_catalog pg_amprocbcid6 +xmin0R# + +pg_catalog +pg_catalog pg_amprocbxid6 +ctid0R# + +pg_catalog +pg_catalog pg_amprocbtid5 +oid0R# + +pg_catalog +pg_catalog pg_amprocboid> + amprocfamily0R# + +pg_catalog +pg_catalog pg_amprocboid@ +amproclefttype0R# + +pg_catalog +pg_catalog pg_amprocboidA +amprocrighttype0R# + +pg_catalog +pg_catalog pg_amprocboid< + amprocnum0R# + +pg_catalog +pg_catalog pg_amprocbint2< +amproc0R# + +pg_catalog +pg_catalog pg_amprocb regprocû +$ + +pg_catalog +pg_catalog +pg_attrdef; +tableoid0R$ + +pg_catalog +pg_catalog +pg_attrdefboid7 +cmax0R$ + +pg_catalog +pg_catalog +pg_attrdefbcid7 +xmax0R$ + +pg_catalog +pg_catalog +pg_attrdefbxid7 +cmin0R$ + +pg_catalog +pg_catalog +pg_attrdefbcid7 +xmin0R$ + +pg_catalog +pg_catalog +pg_attrdefbxid7 +ctid0R$ + +pg_catalog +pg_catalog +pg_attrdefbtid6 +oid0R$ + +pg_catalog +pg_catalog +pg_attrdefboid: +adrelid0R$ + +pg_catalog +pg_catalog +pg_attrdefboid9 +adnum0R$ + +pg_catalog +pg_catalog +pg_attrdefbint2J +adbin0ÿÿÿÿÿÿÿÿÿR$ + +pg_catalog +pg_catalog +pg_attrdefb pg_node_treeé +& + +pg_catalog +pg_catalog pg_attribute= +tableoid0R& + +pg_catalog +pg_catalog pg_attributeboid9 +cmax0R& + +pg_catalog +pg_catalog pg_attributebcid9 +xmax0R& + +pg_catalog +pg_catalog pg_attributebxid9 +cmin0R& + +pg_catalog +pg_catalog pg_attributebcid9 +xmin0R& + +pg_catalog +pg_catalog pg_attributebxid9 +ctid0R& + +pg_catalog +pg_catalog pg_attributebtid= +attrelid0R& + +pg_catalog +pg_catalog pg_attributeboid= +attname0@R& + +pg_catalog +pg_catalog pg_attributebname= +atttypid0R& + +pg_catalog +pg_catalog pg_attributeboidC + attstattarget0R& + +pg_catalog +pg_catalog pg_attributebint4< +attlen0R& + +pg_catalog +pg_catalog pg_attributebint2< +attnum0R& + +pg_catalog +pg_catalog pg_attributebint2> +attndims0R& + +pg_catalog +pg_catalog pg_attributebint4A + attcacheoff0R& + +pg_catalog +pg_catalog pg_attributebint4? + atttypmod0R& + +pg_catalog +pg_catalog pg_attributebint4> +attbyval0R& + +pg_catalog +pg_catalog pg_attributebbool> +attalign0R& + +pg_catalog +pg_catalog pg_attributebchar@ + +attstorage0R& + +pg_catalog +pg_catalog pg_attributebcharD +attcompression0R& + +pg_catalog +pg_catalog pg_attributebchar@ + +attnotnull0R& + +pg_catalog +pg_catalog pg_attributebbool? + atthasdef0R& + +pg_catalog +pg_catalog pg_attributebboolC + atthasmissing0R& + +pg_catalog +pg_catalog pg_attributebboolA + attidentity0R& + +pg_catalog +pg_catalog pg_attributebcharB + attgenerated0R& + +pg_catalog +pg_catalog pg_attributebcharB + attisdropped0R& + +pg_catalog +pg_catalog pg_attributebbool@ + +attislocal0R& + +pg_catalog +pg_catalog pg_attributebboolA + attinhcount0R& + +pg_catalog +pg_catalog pg_attributebint4A + attcollation0R& + +pg_catalog +pg_catalog pg_attributeboidI +attacl 0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_attributeb +_aclitemJ + +attoptions 0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_attributeb_textM + attfdwoptions 0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_attributeb_textN + attmissingval0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_attributeb +anyarray« +) + +pg_catalog +pg_catalogpg_auth_members@ +tableoid0R) + +pg_catalog +pg_catalogpg_auth_membersboid< +cmax0R) + +pg_catalog +pg_catalogpg_auth_membersbcid< +xmax0R) + +pg_catalog +pg_catalogpg_auth_membersbxid< +cmin0R) + +pg_catalog +pg_catalogpg_auth_membersbcid< +xmin0R) + +pg_catalog +pg_catalogpg_auth_membersbxid< +ctid0R) + +pg_catalog +pg_catalogpg_auth_membersbtid> +roleid0R) + +pg_catalog +pg_catalogpg_auth_membersboid> +member0R) + +pg_catalog +pg_catalogpg_auth_membersboid? +grantor0R) + +pg_catalog +pg_catalogpg_auth_membersboidE + admin_option0R) + +pg_catalog +pg_catalogpg_auth_membersbboolý +# + +pg_catalog +pg_catalog pg_authid: +tableoid0R# + +pg_catalog +pg_catalog pg_authidboid6 +cmax0R# + +pg_catalog +pg_catalog pg_authidbcid6 +xmax0R# + +pg_catalog +pg_catalog pg_authidbxid6 +cmin0R# + +pg_catalog +pg_catalog pg_authidbcid6 +xmin0R# + +pg_catalog +pg_catalog pg_authidbxid6 +ctid0R# + +pg_catalog +pg_catalog pg_authidbtid5 +oid0R# + +pg_catalog +pg_catalog pg_authidboid: +rolname0@R# + +pg_catalog +pg_catalog pg_authidbname; +rolsuper0R# + +pg_catalog +pg_catalog pg_authidbbool= + +rolinherit0R# + +pg_catalog +pg_catalog pg_authidbbool@ + rolcreaterole0R# + +pg_catalog +pg_catalog pg_authidbbool> + rolcreatedb0R# + +pg_catalog +pg_catalog pg_authidbbool> + rolcanlogin0R# + +pg_catalog +pg_catalog pg_authidbboolA +rolreplication0R# + +pg_catalog +pg_catalog pg_authidbbool? + rolbypassrls0R# + +pg_catalog +pg_catalog pg_authidbbool? + rolconnlimit0R# + +pg_catalog +pg_catalog pg_authidbint4E + rolpassword0ÿÿÿÿÿÿÿÿÿR# + +pg_catalog +pg_catalog pg_authidbtextE + rolvaliduntil0R# + +pg_catalog +pg_catalog pg_authidb  timestamptz® +9 + +pg_catalog +pg_catalogpg_available_extension_versionsK +name0@R9 + +pg_catalog +pg_catalogpg_available_extension_versionsbnameW +version0ÿÿÿÿÿÿÿÿÿR9 + +pg_catalog +pg_catalogpg_available_extension_versionsbtextP + installed0R9 + +pg_catalog +pg_catalogpg_available_extension_versionsbboolP + superuser0R9 + +pg_catalog +pg_catalogpg_available_extension_versionsbboolN +trusted0R9 + +pg_catalog +pg_catalogpg_available_extension_versionsbboolR + relocatable0R9 + +pg_catalog +pg_catalogpg_available_extension_versionsbboolM +schema0@R9 + +pg_catalog +pg_catalogpg_available_extension_versionsbname[ +requires 0ÿÿÿÿÿÿÿÿÿR9 + +pg_catalog +pg_catalogpg_available_extension_versionsb_nameW +comment0ÿÿÿÿÿÿÿÿÿR9 + +pg_catalog +pg_catalogpg_available_extension_versionsbtextý +1 + +pg_catalog +pg_catalogpg_available_extensionsC +name0@R1 + +pg_catalog +pg_catalogpg_available_extensionsbnameW +default_version0ÿÿÿÿÿÿÿÿÿR1 + +pg_catalog +pg_catalogpg_available_extensionsbtextY +installed_version0ÿÿÿÿÿÿÿÿÿR1 + +pg_catalog +pg_catalogpg_available_extensionsbtextO +comment0ÿÿÿÿÿÿÿÿÿR1 + +pg_catalog +pg_catalogpg_available_extensionsbtext€ +4 + +pg_catalog +pg_catalogpg_backend_memory_contextsO +name0ÿÿÿÿÿÿÿÿÿR4 + +pg_catalog +pg_catalogpg_backend_memory_contextsbtextP +ident0ÿÿÿÿÿÿÿÿÿR4 + +pg_catalog +pg_catalogpg_backend_memory_contextsbtextQ +parent0ÿÿÿÿÿÿÿÿÿR4 + +pg_catalog +pg_catalogpg_backend_memory_contextsbtextG +level0R4 + +pg_catalog +pg_catalogpg_backend_memory_contextsbint4M + total_bytes0R4 + +pg_catalog +pg_catalogpg_backend_memory_contextsbint8O + total_nblocks0R4 + +pg_catalog +pg_catalogpg_backend_memory_contextsbint8L + +free_bytes0R4 + +pg_catalog +pg_catalogpg_backend_memory_contextsbint8M + free_chunks0R4 + +pg_catalog +pg_catalogpg_backend_memory_contextsbint8L + +used_bytes0R4 + +pg_catalog +pg_catalogpg_backend_memory_contextsbint8Í +! + +pg_catalog +pg_catalogpg_cast8 +tableoid0R! + +pg_catalog +pg_catalogpg_castboid4 +cmax0R! + +pg_catalog +pg_catalogpg_castbcid4 +xmax0R! + +pg_catalog +pg_catalogpg_castbxid4 +cmin0R! + +pg_catalog +pg_catalogpg_castbcid4 +xmin0R! + +pg_catalog +pg_catalogpg_castbxid4 +ctid0R! + +pg_catalog +pg_catalogpg_castbtid3 +oid0R! + +pg_catalog +pg_catalogpg_castboid: + +castsource0R! + +pg_catalog +pg_catalogpg_castboid: + +casttarget0R! + +pg_catalog +pg_catalogpg_castboid8 +castfunc0R! + +pg_catalog +pg_catalogpg_castboid< + castcontext0R! + +pg_catalog +pg_catalogpg_castbchar; + +castmethod0R! + +pg_catalog +pg_catalogpg_castbchar  +" + +pg_catalog +pg_catalogpg_class9 +tableoid0R" + +pg_catalog +pg_catalogpg_classboid5 +cmax0R" + +pg_catalog +pg_catalogpg_classbcid5 +xmax0R" + +pg_catalog +pg_catalogpg_classbxid5 +cmin0R" + +pg_catalog +pg_catalogpg_classbcid5 +xmin0R" + +pg_catalog +pg_catalogpg_classbxid5 +ctid0R" + +pg_catalog +pg_catalogpg_classbtid4 +oid0R" + +pg_catalog +pg_catalogpg_classboid9 +relname0@R" + +pg_catalog +pg_catalogpg_classbname= + relnamespace0R" + +pg_catalog +pg_catalogpg_classboid8 +reltype0R" + +pg_catalog +pg_catalogpg_classboid: + reloftype0R" + +pg_catalog +pg_catalogpg_classboid9 +relowner0R" + +pg_catalog +pg_catalogpg_classboid6 +relam0R" + +pg_catalog +pg_catalogpg_classboid< + relfilenode0R" + +pg_catalog +pg_catalogpg_classboid> + reltablespace0R" + +pg_catalog +pg_catalogpg_classboid: +relpages0R" + +pg_catalog +pg_catalogpg_classbint4= + reltuples0R" + +pg_catalog +pg_catalogpg_classbfloat4? + relallvisible0R" + +pg_catalog +pg_catalogpg_classbint4> + reltoastrelid0R" + +pg_catalog +pg_catalogpg_classboid= + relhasindex0R" + +pg_catalog +pg_catalogpg_classbbool= + relisshared0R" + +pg_catalog +pg_catalogpg_classbbool@ +relpersistence0R" + +pg_catalog +pg_catalogpg_classbchar9 +relkind0R" + +pg_catalog +pg_catalogpg_classbchar: +relnatts0R" + +pg_catalog +pg_catalogpg_classbint2; + relchecks0R" + +pg_catalog +pg_catalogpg_classbint2= + relhasrules0R" + +pg_catalog +pg_catalogpg_classbbool@ +relhastriggers0R" + +pg_catalog +pg_catalogpg_classbbool@ +relhassubclass0R" + +pg_catalog +pg_catalogpg_classbbool@ +relrowsecurity0R" + +pg_catalog +pg_catalogpg_classbboolE +relforcerowsecurity0R" + +pg_catalog +pg_catalogpg_classbbool@ +relispopulated0R" + +pg_catalog +pg_catalogpg_classbbool> + relreplident0R" + +pg_catalog +pg_catalogpg_classbchar@ +relispartition0R" + +pg_catalog +pg_catalogpg_classbbool; + +relrewrite0R" + +pg_catalog +pg_catalogpg_classboid= + relfrozenxid0R" + +pg_catalog +pg_catalogpg_classbxid; + +relminmxid0R" + +pg_catalog +pg_catalogpg_classbxidE +relacl 0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_classb +_aclitemF + +reloptions 0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_classb_textM + relpartbound0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_classb pg_node_tree‡ +& + +pg_catalog +pg_catalog pg_collation= +tableoid0R& + +pg_catalog +pg_catalog pg_collationboid9 +cmax0R& + +pg_catalog +pg_catalog pg_collationbcid9 +xmax0R& + +pg_catalog +pg_catalog pg_collationbxid9 +cmin0R& + +pg_catalog +pg_catalog pg_collationbcid9 +xmin0R& + +pg_catalog +pg_catalog pg_collationbxid9 +ctid0R& + +pg_catalog +pg_catalog pg_collationbtid8 +oid0R& + +pg_catalog +pg_catalog pg_collationboid> +collname0@R& + +pg_catalog +pg_catalog pg_collationbnameB + collnamespace0R& + +pg_catalog +pg_catalog pg_collationboid> + collowner0R& + +pg_catalog +pg_catalog pg_collationboidB + collprovider0R& + +pg_catalog +pg_catalog pg_collationbcharI +collisdeterministic0R& + +pg_catalog +pg_catalog pg_collationbboolB + collencoding0R& + +pg_catalog +pg_catalog pg_collationbint4H + collcollate0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_collationbtextF + collctype0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_collationbtextJ + colliculocale0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_collationbtextH + collversion0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_collationbtext¨ +# + +pg_catalog +pg_catalog pg_config> +name0ÿÿÿÿÿÿÿÿÿR# + +pg_catalog +pg_catalog pg_configbtextA +setting0ÿÿÿÿÿÿÿÿÿR# + +pg_catalog +pg_catalog pg_configbtextŸ +' + +pg_catalog +pg_catalog pg_constraint> +tableoid0R' + +pg_catalog +pg_catalog pg_constraintboid: +cmax0R' + +pg_catalog +pg_catalog pg_constraintbcid: +xmax0R' + +pg_catalog +pg_catalog pg_constraintbxid: +cmin0R' + +pg_catalog +pg_catalog pg_constraintbcid: +xmin0R' + +pg_catalog +pg_catalog pg_constraintbxid: +ctid0R' + +pg_catalog +pg_catalog pg_constraintbtid9 +oid0R' + +pg_catalog +pg_catalog pg_constraintboid> +conname0@R' + +pg_catalog +pg_catalog pg_constraintbnameB + connamespace0R' + +pg_catalog +pg_catalog pg_constraintboid> +contype0R' + +pg_catalog +pg_catalog pg_constraintbcharD + condeferrable0R' + +pg_catalog +pg_catalog pg_constraintbboolB + condeferred0R' + +pg_catalog +pg_catalog pg_constraintbboolC + convalidated0R' + +pg_catalog +pg_catalog pg_constraintbbool> +conrelid0R' + +pg_catalog +pg_catalog pg_constraintboid> +contypid0R' + +pg_catalog +pg_catalog pg_constraintboid> +conindid0R' + +pg_catalog +pg_catalog pg_constraintboidA + conparentid0R' + +pg_catalog +pg_catalog pg_constraintboid? + confrelid0R' + +pg_catalog +pg_catalog pg_constraintboidB + confupdtype0R' + +pg_catalog +pg_catalog pg_constraintbcharB + confdeltype0R' + +pg_catalog +pg_catalog pg_constraintbcharD + confmatchtype0R' + +pg_catalog +pg_catalog pg_constraintbcharA + +conislocal0R' + +pg_catalog +pg_catalog pg_constraintbboolB + coninhcount0R' + +pg_catalog +pg_catalog pg_constraintbint4C + connoinherit0R' + +pg_catalog +pg_catalog pg_constraintbboolG +conkey 0ÿÿÿÿÿÿÿÿÿR' + +pg_catalog +pg_catalog pg_constraintb_int2H +confkey 0ÿÿÿÿÿÿÿÿÿR' + +pg_catalog +pg_catalog pg_constraintb_int2I + conpfeqop 0ÿÿÿÿÿÿÿÿÿR' + +pg_catalog +pg_catalog pg_constraintb_oidI + conppeqop 0ÿÿÿÿÿÿÿÿÿR' + +pg_catalog +pg_catalog pg_constraintb_oidI + conffeqop 0ÿÿÿÿÿÿÿÿÿR' + +pg_catalog +pg_catalog pg_constraintb_oidO +confdelsetcols 0ÿÿÿÿÿÿÿÿÿR' + +pg_catalog +pg_catalog pg_constraintb_int2I + conexclop 0ÿÿÿÿÿÿÿÿÿR' + +pg_catalog +pg_catalog pg_constraintb_oidL +conbin0ÿÿÿÿÿÿÿÿÿR' + +pg_catalog +pg_catalog pg_constraintb pg_node_tree§ +' + +pg_catalog +pg_catalog pg_conversion> +tableoid0R' + +pg_catalog +pg_catalog pg_conversionboid: +cmax0R' + +pg_catalog +pg_catalog pg_conversionbcid: +xmax0R' + +pg_catalog +pg_catalog pg_conversionbxid: +cmin0R' + +pg_catalog +pg_catalog pg_conversionbcid: +xmin0R' + +pg_catalog +pg_catalog pg_conversionbxid: +ctid0R' + +pg_catalog +pg_catalog pg_conversionbtid9 +oid0R' + +pg_catalog +pg_catalog pg_conversionboid> +conname0@R' + +pg_catalog +pg_catalog pg_conversionbnameB + connamespace0R' + +pg_catalog +pg_catalog pg_conversionboid> +conowner0R' + +pg_catalog +pg_catalog pg_conversionboidE +conforencoding0R' + +pg_catalog +pg_catalog pg_conversionbint4D + contoencoding0R' + +pg_catalog +pg_catalog pg_conversionbint4A +conproc0R' + +pg_catalog +pg_catalog pg_conversionb regprocA + +condefault0R' + +pg_catalog +pg_catalog pg_conversionbbool² +$ + +pg_catalog +pg_catalog +pg_cursors? +name0ÿÿÿÿÿÿÿÿÿR$ + +pg_catalog +pg_catalog +pg_cursorsbtextD + statement0ÿÿÿÿÿÿÿÿÿR$ + +pg_catalog +pg_catalog +pg_cursorsbtext= + is_holdable0R$ + +pg_catalog +pg_catalog +pg_cursorsbbool; + is_binary0R$ + +pg_catalog +pg_catalog +pg_cursorsbbool? + is_scrollable0R$ + +pg_catalog +pg_catalog +pg_cursorsbboolF + creation_time0R$ + +pg_catalog +pg_catalog +pg_cursorsb  timestamptz¿ +% + +pg_catalog +pg_catalog pg_database< +tableoid0R% + +pg_catalog +pg_catalog pg_databaseboid8 +cmax0R% + +pg_catalog +pg_catalog pg_databasebcid8 +xmax0R% + +pg_catalog +pg_catalog pg_databasebxid8 +cmin0R% + +pg_catalog +pg_catalog pg_databasebcid8 +xmin0R% + +pg_catalog +pg_catalog pg_databasebxid8 +ctid0R% + +pg_catalog +pg_catalog pg_databasebtid7 +oid0R% + +pg_catalog +pg_catalog pg_databaseboid< +datname0@R% + +pg_catalog +pg_catalog pg_databasebname: +datdba0R% + +pg_catalog +pg_catalog pg_databaseboid= +encoding0R% + +pg_catalog +pg_catalog pg_databasebint4C +datlocprovider0R% + +pg_catalog +pg_catalog pg_databasebcharB + datistemplate0R% + +pg_catalog +pg_catalog pg_databasebboolA + datallowconn0R% + +pg_catalog +pg_catalog pg_databasebboolA + datconnlimit0R% + +pg_catalog +pg_catalog pg_databasebint4@ + datfrozenxid0R% + +pg_catalog +pg_catalog pg_databasebxid> + +datminmxid0R% + +pg_catalog +pg_catalog pg_databasebxidA + dattablespace0R% + +pg_catalog +pg_catalog pg_databaseboidH + +datcollate0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_databasebtextF +datctype0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_databasebtextH + daticulocale0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_databasebtextJ +datcollversion0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_databasebtextH +datacl 0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_databaseb +_aclitem• +, + +pg_catalog +pg_catalogpg_db_role_settingC +tableoid0R, + +pg_catalog +pg_catalogpg_db_role_settingboid? +cmax0R, + +pg_catalog +pg_catalogpg_db_role_settingbcid? +xmax0R, + +pg_catalog +pg_catalogpg_db_role_settingbxid? +cmin0R, + +pg_catalog +pg_catalogpg_db_role_settingbcid? +xmin0R, + +pg_catalog +pg_catalogpg_db_role_settingbxid? +ctid0R, + +pg_catalog +pg_catalogpg_db_role_settingbtidF + setdatabase0R, + +pg_catalog +pg_catalogpg_db_role_settingboidB +setrole0R, + +pg_catalog +pg_catalogpg_db_role_settingboidO + setconfig 0ÿÿÿÿÿÿÿÿÿR, + +pg_catalog +pg_catalogpg_db_role_settingb_textü +( + +pg_catalog +pg_catalogpg_default_acl? +tableoid0R( + +pg_catalog +pg_catalogpg_default_aclboid; +cmax0R( + +pg_catalog +pg_catalogpg_default_aclbcid; +xmax0R( + +pg_catalog +pg_catalogpg_default_aclbxid; +cmin0R( + +pg_catalog +pg_catalogpg_default_aclbcid; +xmin0R( + +pg_catalog +pg_catalogpg_default_aclbxid; +ctid0R( + +pg_catalog +pg_catalogpg_default_aclbtid: +oid0R( + +pg_catalog +pg_catalogpg_default_aclboidA + +defaclrole0R( + +pg_catalog +pg_catalogpg_default_aclboidF +defaclnamespace0R( + +pg_catalog +pg_catalogpg_default_aclboidE + defaclobjtype0R( + +pg_catalog +pg_catalogpg_default_aclbcharP + defaclacl 0ÿÿÿÿÿÿÿÿÿR( + +pg_catalog +pg_catalogpg_default_aclb +_aclitem  +# + +pg_catalog +pg_catalog pg_depend: +tableoid0R# + +pg_catalog +pg_catalog pg_dependboid6 +cmax0R# + +pg_catalog +pg_catalog pg_dependbcid6 +xmax0R# + +pg_catalog +pg_catalog pg_dependbxid6 +cmin0R# + +pg_catalog +pg_catalog pg_dependbcid6 +xmin0R# + +pg_catalog +pg_catalog pg_dependbxid6 +ctid0R# + +pg_catalog +pg_catalog pg_dependbtid9 +classid0R# + +pg_catalog +pg_catalog pg_dependboid7 +objid0R# + +pg_catalog +pg_catalog pg_dependboid; +objsubid0R# + +pg_catalog +pg_catalog pg_dependbint4< + +refclassid0R# + +pg_catalog +pg_catalog pg_dependboid: +refobjid0R# + +pg_catalog +pg_catalog pg_dependboid> + refobjsubid0R# + +pg_catalog +pg_catalog pg_dependbint4: +deptype0R# + +pg_catalog +pg_catalog pg_dependbchar¬ +( + +pg_catalog +pg_catalogpg_description? +tableoid0R( + +pg_catalog +pg_catalogpg_descriptionboid; +cmax0R( + +pg_catalog +pg_catalogpg_descriptionbcid; +xmax0R( + +pg_catalog +pg_catalogpg_descriptionbxid; +cmin0R( + +pg_catalog +pg_catalogpg_descriptionbcid; +xmin0R( + +pg_catalog +pg_catalogpg_descriptionbxid; +ctid0R( + +pg_catalog +pg_catalogpg_descriptionbtid= +objoid0R( + +pg_catalog +pg_catalogpg_descriptionboid? +classoid0R( + +pg_catalog +pg_catalogpg_descriptionboid@ +objsubid0R( + +pg_catalog +pg_catalogpg_descriptionbint4L + description0ÿÿÿÿÿÿÿÿÿR( + +pg_catalog +pg_catalogpg_descriptionbtextÙ +! + +pg_catalog +pg_catalogpg_enum8 +tableoid0R! + +pg_catalog +pg_catalogpg_enumboid4 +cmax0R! + +pg_catalog +pg_catalogpg_enumbcid4 +xmax0R! + +pg_catalog +pg_catalogpg_enumbxid4 +cmin0R! + +pg_catalog +pg_catalogpg_enumbcid4 +xmin0R! + +pg_catalog +pg_catalogpg_enumbxid4 +ctid0R! + +pg_catalog +pg_catalogpg_enumbtid3 +oid0R! + +pg_catalog +pg_catalogpg_enumboid9 + enumtypid0R! + +pg_catalog +pg_catalogpg_enumboid@ + enumsortorder0R! + +pg_catalog +pg_catalogpg_enumbfloat4: + enumlabel0@R! + +pg_catalog +pg_catalogpg_enumbname‡ +* + +pg_catalog +pg_catalogpg_event_triggerA +tableoid0R* + +pg_catalog +pg_catalogpg_event_triggerboid= +cmax0R* + +pg_catalog +pg_catalogpg_event_triggerbcid= +xmax0R* + +pg_catalog +pg_catalogpg_event_triggerbxid= +cmin0R* + +pg_catalog +pg_catalogpg_event_triggerbcid= +xmin0R* + +pg_catalog +pg_catalogpg_event_triggerbxid= +ctid0R* + +pg_catalog +pg_catalogpg_event_triggerbtid< +oid0R* + +pg_catalog +pg_catalogpg_event_triggerboidA +evtname0@R* + +pg_catalog +pg_catalogpg_event_triggerbnameB +evtevent0@R* + +pg_catalog +pg_catalogpg_event_triggerbnameA +evtowner0R* + +pg_catalog +pg_catalogpg_event_triggerboid@ +evtfoid0R* + +pg_catalog +pg_catalogpg_event_triggerboidD + +evtenabled0R* + +pg_catalog +pg_catalogpg_event_triggerbcharK +evttags 0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_event_triggerb_text² +& + +pg_catalog +pg_catalog pg_extension= +tableoid0R& + +pg_catalog +pg_catalog pg_extensionboid9 +cmax0R& + +pg_catalog +pg_catalog pg_extensionbcid9 +xmax0R& + +pg_catalog +pg_catalog pg_extensionbxid9 +cmin0R& + +pg_catalog +pg_catalog pg_extensionbcid9 +xmin0R& + +pg_catalog +pg_catalog pg_extensionbxid9 +ctid0R& + +pg_catalog +pg_catalog pg_extensionbtid8 +oid0R& + +pg_catalog +pg_catalog pg_extensionboid= +extname0@R& + +pg_catalog +pg_catalog pg_extensionbname= +extowner0R& + +pg_catalog +pg_catalog pg_extensionboidA + extnamespace0R& + +pg_catalog +pg_catalog pg_extensionboidD +extrelocatable0R& + +pg_catalog +pg_catalog pg_extensionbboolI + +extversion0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_extensionbtextH + extconfig 0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_extensionb_oidL + extcondition 0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_extensionb_text– +* + +pg_catalog +pg_catalogpg_file_settingsK + +sourcefile0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_file_settingsbtextB + +sourceline0R* + +pg_catalog +pg_catalogpg_file_settingsbint4= +seqno0R* + +pg_catalog +pg_catalogpg_file_settingsbint4E +name0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_file_settingsbtextH +setting0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_file_settingsbtext? +applied0R* + +pg_catalog +pg_catalogpg_file_settingsbboolF +error0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_file_settingsbtextû +1 + +pg_catalog +pg_catalogpg_foreign_data_wrapperH +tableoid0R1 + +pg_catalog +pg_catalogpg_foreign_data_wrapperboidD +cmax0R1 + +pg_catalog +pg_catalogpg_foreign_data_wrapperbcidD +xmax0R1 + +pg_catalog +pg_catalogpg_foreign_data_wrapperbxidD +cmin0R1 + +pg_catalog +pg_catalogpg_foreign_data_wrapperbcidD +xmin0R1 + +pg_catalog +pg_catalogpg_foreign_data_wrapperbxidD +ctid0R1 + +pg_catalog +pg_catalogpg_foreign_data_wrapperbtidC +oid0R1 + +pg_catalog +pg_catalogpg_foreign_data_wrapperboidH +fdwname0@R1 + +pg_catalog +pg_catalogpg_foreign_data_wrapperbnameH +fdwowner0R1 + +pg_catalog +pg_catalogpg_foreign_data_wrapperboidJ + +fdwhandler0R1 + +pg_catalog +pg_catalogpg_foreign_data_wrapperboidL + fdwvalidator0R1 + +pg_catalog +pg_catalogpg_foreign_data_wrapperboidT +fdwacl 0ÿÿÿÿÿÿÿÿÿR1 + +pg_catalog +pg_catalogpg_foreign_data_wrapperb +_aclitemU + +fdwoptions 0ÿÿÿÿÿÿÿÿÿR1 + +pg_catalog +pg_catalogpg_foreign_data_wrapperb_textô ++ + +pg_catalog +pg_catalogpg_foreign_serverB +tableoid0R+ + +pg_catalog +pg_catalogpg_foreign_serverboid> +cmax0R+ + +pg_catalog +pg_catalogpg_foreign_serverbcid> +xmax0R+ + +pg_catalog +pg_catalogpg_foreign_serverbxid> +cmin0R+ + +pg_catalog +pg_catalogpg_foreign_serverbcid> +xmin0R+ + +pg_catalog +pg_catalogpg_foreign_serverbxid> +ctid0R+ + +pg_catalog +pg_catalogpg_foreign_serverbtid= +oid0R+ + +pg_catalog +pg_catalogpg_foreign_serverboidB +srvname0@R+ + +pg_catalog +pg_catalogpg_foreign_serverbnameB +srvowner0R+ + +pg_catalog +pg_catalogpg_foreign_serverboid@ +srvfdw0R+ + +pg_catalog +pg_catalogpg_foreign_serverboidI +srvtype0ÿÿÿÿÿÿÿÿÿR+ + +pg_catalog +pg_catalogpg_foreign_serverbtextL + +srvversion0ÿÿÿÿÿÿÿÿÿR+ + +pg_catalog +pg_catalogpg_foreign_serverbtextN +srvacl 0ÿÿÿÿÿÿÿÿÿR+ + +pg_catalog +pg_catalogpg_foreign_serverb +_aclitemO + +srvoptions 0ÿÿÿÿÿÿÿÿÿR+ + +pg_catalog +pg_catalogpg_foreign_serverb_textþ +* + +pg_catalog +pg_catalogpg_foreign_tableA +tableoid0R* + +pg_catalog +pg_catalogpg_foreign_tableboid= +cmax0R* + +pg_catalog +pg_catalogpg_foreign_tablebcid= +xmax0R* + +pg_catalog +pg_catalogpg_foreign_tablebxid= +cmin0R* + +pg_catalog +pg_catalogpg_foreign_tablebcid= +xmin0R* + +pg_catalog +pg_catalogpg_foreign_tablebxid= +ctid0R* + +pg_catalog +pg_catalogpg_foreign_tablebtid@ +ftrelid0R* + +pg_catalog +pg_catalogpg_foreign_tableboidA +ftserver0R* + +pg_catalog +pg_catalogpg_foreign_tableboidM + ftoptions 0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_foreign_tableb_textÚ +" + +pg_catalog +pg_catalogpg_group7 +groname0@R" + +pg_catalog +pg_catalogpg_groupbname7 +grosysid0R" + +pg_catalog +pg_catalogpg_groupboidB +grolist 0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_groupb_oidÖ ++ + +pg_catalog +pg_catalogpg_hba_file_rulesD + line_number0R+ + +pg_catalog +pg_catalogpg_hba_file_rulesbint4F +type0ÿÿÿÿÿÿÿÿÿR+ + +pg_catalog +pg_catalogpg_hba_file_rulesbtextM +database 0ÿÿÿÿÿÿÿÿÿR+ + +pg_catalog +pg_catalogpg_hba_file_rulesb_textN + user_name 0ÿÿÿÿÿÿÿÿÿR+ + +pg_catalog +pg_catalogpg_hba_file_rulesb_textI +address0ÿÿÿÿÿÿÿÿÿR+ + +pg_catalog +pg_catalogpg_hba_file_rulesbtextI +netmask0ÿÿÿÿÿÿÿÿÿR+ + +pg_catalog +pg_catalogpg_hba_file_rulesbtextM + auth_method0ÿÿÿÿÿÿÿÿÿR+ + +pg_catalog +pg_catalogpg_hba_file_rulesbtextL +options 0ÿÿÿÿÿÿÿÿÿR+ + +pg_catalog +pg_catalogpg_hba_file_rulesb_textG +error0ÿÿÿÿÿÿÿÿÿR+ + +pg_catalog +pg_catalogpg_hba_file_rulesbtextÁ +0 + +pg_catalog +pg_catalogpg_ident_file_mappingsI + line_number0R0 + +pg_catalog +pg_catalogpg_ident_file_mappingsbint4O +map_name0ÿÿÿÿÿÿÿÿÿR0 + +pg_catalog +pg_catalogpg_ident_file_mappingsbtextO +sys_name0ÿÿÿÿÿÿÿÿÿR0 + +pg_catalog +pg_catalogpg_ident_file_mappingsbtextR + pg_username0ÿÿÿÿÿÿÿÿÿR0 + +pg_catalog +pg_catalogpg_ident_file_mappingsbtextL +error0ÿÿÿÿÿÿÿÿÿR0 + +pg_catalog +pg_catalogpg_ident_file_mappingsbtextô +" + +pg_catalog +pg_catalogpg_index9 +tableoid0R" + +pg_catalog +pg_catalogpg_indexboid5 +cmax0R" + +pg_catalog +pg_catalogpg_indexbcid5 +xmax0R" + +pg_catalog +pg_catalogpg_indexbxid5 +cmin0R" + +pg_catalog +pg_catalogpg_indexbcid5 +xmin0R" + +pg_catalog +pg_catalogpg_indexbxid5 +ctid0R" + +pg_catalog +pg_catalogpg_indexbtid; + +indexrelid0R" + +pg_catalog +pg_catalogpg_indexboid9 +indrelid0R" + +pg_catalog +pg_catalogpg_indexboid: +indnatts0R" + +pg_catalog +pg_catalogpg_indexbint2= + indnkeyatts0R" + +pg_catalog +pg_catalogpg_indexbint2= + indisunique0R" + +pg_catalog +pg_catalogpg_indexbboolE +indnullsnotdistinct0R" + +pg_catalog +pg_catalogpg_indexbbool> + indisprimary0R" + +pg_catalog +pg_catalogpg_indexbbool@ +indisexclusion0R" + +pg_catalog +pg_catalogpg_indexbbool> + indimmediate0R" + +pg_catalog +pg_catalogpg_indexbbool@ +indisclustered0R" + +pg_catalog +pg_catalogpg_indexbbool< + +indisvalid0R" + +pg_catalog +pg_catalogpg_indexbbool> + indcheckxmin0R" + +pg_catalog +pg_catalogpg_indexbbool< + +indisready0R" + +pg_catalog +pg_catalogpg_indexbbool; + indislive0R" + +pg_catalog +pg_catalogpg_indexbbool@ +indisreplident0R" + +pg_catalog +pg_catalogpg_indexbboolI +indkey 0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_indexb  +int2vectorN + indcollation 0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_indexb  oidvectorJ +indclass 0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_indexb  oidvectorL + indoption 0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_indexb  +int2vectorI +indexprs0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_indexb pg_node_treeH +indpred0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_indexb pg_node_treeá +$ + +pg_catalog +pg_catalog +pg_indexes< + +schemaname0@R$ + +pg_catalog +pg_catalog +pg_indexesbname; + tablename0@R$ + +pg_catalog +pg_catalog +pg_indexesbname; + indexname0@R$ + +pg_catalog +pg_catalog +pg_indexesbname< + +tablespace0@R$ + +pg_catalog +pg_catalog +pg_indexesbnameC +indexdef0ÿÿÿÿÿÿÿÿÿR$ + +pg_catalog +pg_catalog +pg_indexesbtextŠ +% + +pg_catalog +pg_catalog pg_inherits< +tableoid0R% + +pg_catalog +pg_catalog pg_inheritsboid8 +cmax0R% + +pg_catalog +pg_catalog pg_inheritsbcid8 +xmax0R% + +pg_catalog +pg_catalog pg_inheritsbxid8 +cmin0R% + +pg_catalog +pg_catalog pg_inheritsbcid8 +xmin0R% + +pg_catalog +pg_catalog pg_inheritsbxid8 +ctid0R% + +pg_catalog +pg_catalog pg_inheritsbtid< +inhrelid0R% + +pg_catalog +pg_catalog pg_inheritsboid= + inhparent0R% + +pg_catalog +pg_catalog pg_inheritsboid= +inhseqno0R% + +pg_catalog +pg_catalog pg_inheritsbint4E +inhdetachpending0R% + +pg_catalog +pg_catalog pg_inheritsbboolæ +' + +pg_catalog +pg_catalog pg_init_privs> +tableoid0R' + +pg_catalog +pg_catalog pg_init_privsboid: +cmax0R' + +pg_catalog +pg_catalog pg_init_privsbcid: +xmax0R' + +pg_catalog +pg_catalog pg_init_privsbxid: +cmin0R' + +pg_catalog +pg_catalog pg_init_privsbcid: +xmin0R' + +pg_catalog +pg_catalog pg_init_privsbxid: +ctid0R' + +pg_catalog +pg_catalog pg_init_privsbtid< +objoid0R' + +pg_catalog +pg_catalog pg_init_privsboid> +classoid0R' + +pg_catalog +pg_catalog pg_init_privsboid? +objsubid0R' + +pg_catalog +pg_catalog pg_init_privsbint4? +privtype0R' + +pg_catalog +pg_catalog pg_init_privsbcharO + initprivs 0ÿÿÿÿÿÿÿÿÿR' + +pg_catalog +pg_catalog pg_init_privsb +_aclitemË +% + +pg_catalog +pg_catalog pg_language< +tableoid0R% + +pg_catalog +pg_catalog pg_languageboid8 +cmax0R% + +pg_catalog +pg_catalog pg_languagebcid8 +xmax0R% + +pg_catalog +pg_catalog pg_languagebxid8 +cmin0R% + +pg_catalog +pg_catalog pg_languagebcid8 +xmin0R% + +pg_catalog +pg_catalog pg_languagebxid8 +ctid0R% + +pg_catalog +pg_catalog pg_languagebtid7 +oid0R% + +pg_catalog +pg_catalog pg_languageboid< +lanname0@R% + +pg_catalog +pg_catalog pg_languagebname< +lanowner0R% + +pg_catalog +pg_catalog pg_languageboid< +lanispl0R% + +pg_catalog +pg_catalog pg_languagebboolA + lanpltrusted0R% + +pg_catalog +pg_catalog pg_languagebboolA + lanplcallfoid0R% + +pg_catalog +pg_catalog pg_languageboid= + laninline0R% + +pg_catalog +pg_catalog pg_languageboid@ + lanvalidator0R% + +pg_catalog +pg_catalog pg_languageboidH +lanacl 0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_languageb +_aclitemá +( + +pg_catalog +pg_catalogpg_largeobject? +tableoid0R( + +pg_catalog +pg_catalogpg_largeobjectboid; +cmax0R( + +pg_catalog +pg_catalogpg_largeobjectbcid; +xmax0R( + +pg_catalog +pg_catalogpg_largeobjectbxid; +cmin0R( + +pg_catalog +pg_catalogpg_largeobjectbcid; +xmin0R( + +pg_catalog +pg_catalogpg_largeobjectbxid; +ctid0R( + +pg_catalog +pg_catalogpg_largeobjectbtid; +loid0R( + +pg_catalog +pg_catalogpg_largeobjectboid> +pageno0R( + +pg_catalog +pg_catalogpg_largeobjectbint4F +data0ÿÿÿÿÿÿÿÿÿR( + +pg_catalog +pg_catalogpg_largeobjectbbyteaÀ +1 + +pg_catalog +pg_catalogpg_largeobject_metadataH +tableoid0R1 + +pg_catalog +pg_catalogpg_largeobject_metadataboidD +cmax0R1 + +pg_catalog +pg_catalogpg_largeobject_metadatabcidD +xmax0R1 + +pg_catalog +pg_catalogpg_largeobject_metadatabxidD +cmin0R1 + +pg_catalog +pg_catalogpg_largeobject_metadatabcidD +xmin0R1 + +pg_catalog +pg_catalogpg_largeobject_metadatabxidD +ctid0R1 + +pg_catalog +pg_catalogpg_largeobject_metadatabtidC +oid0R1 + +pg_catalog +pg_catalogpg_largeobject_metadataboidH +lomowner0R1 + +pg_catalog +pg_catalogpg_largeobject_metadataboidT +lomacl 0ÿÿÿÿÿÿÿÿÿR1 + +pg_catalog +pg_catalogpg_largeobject_metadatab +_aclitemç +" + +pg_catalog +pg_catalogpg_locksA +locktype0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_locksbtext7 +database0R" + +pg_catalog +pg_catalogpg_locksboid7 +relation0R" + +pg_catalog +pg_catalogpg_locksboid4 +page0R" + +pg_catalog +pg_catalogpg_locksbint45 +tuple0R" + +pg_catalog +pg_catalogpg_locksbint2C + +virtualxid0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_locksbtext< + transactionid0R" + +pg_catalog +pg_catalogpg_locksbxid6 +classid0R" + +pg_catalog +pg_catalogpg_locksboid4 +objid0R" + +pg_catalog +pg_catalogpg_locksboid8 +objsubid0R" + +pg_catalog +pg_catalogpg_locksbint2K +virtualtransaction0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_locksbtext3 +pid0R" + +pg_catalog +pg_catalogpg_locksbint4= +mode0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_locksbtext7 +granted0R" + +pg_catalog +pg_catalogpg_locksbbool8 +fastpath0R" + +pg_catalog +pg_catalogpg_locksbbool@ + waitstart0R" + +pg_catalog +pg_catalogpg_locksb  timestamptzí +% + +pg_catalog +pg_catalog pg_matviews= + +schemaname0@R% + +pg_catalog +pg_catalog pg_matviewsbname> + matviewname0@R% + +pg_catalog +pg_catalog pg_matviewsbname? + matviewowner0@R% + +pg_catalog +pg_catalog pg_matviewsbname= + +tablespace0@R% + +pg_catalog +pg_catalog pg_matviewsbname= + +hasindexes0R% + +pg_catalog +pg_catalog pg_matviewsbbool> + ispopulated0R% + +pg_catalog +pg_catalog pg_matviewsbboolF + +definition0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_matviewsbtext‘ +& + +pg_catalog +pg_catalog pg_namespace= +tableoid0R& + +pg_catalog +pg_catalog pg_namespaceboid9 +cmax0R& + +pg_catalog +pg_catalog pg_namespacebcid9 +xmax0R& + +pg_catalog +pg_catalog pg_namespacebxid9 +cmin0R& + +pg_catalog +pg_catalog pg_namespacebcid9 +xmin0R& + +pg_catalog +pg_catalog pg_namespacebxid9 +ctid0R& + +pg_catalog +pg_catalog pg_namespacebtid8 +oid0R& + +pg_catalog +pg_catalog pg_namespaceboid= +nspname0@R& + +pg_catalog +pg_catalog pg_namespacebname= +nspowner0R& + +pg_catalog +pg_catalog pg_namespaceboidI +nspacl 0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_namespaceb +_aclitem¬ +$ + +pg_catalog +pg_catalog +pg_opclass; +tableoid0R$ + +pg_catalog +pg_catalog +pg_opclassboid7 +cmax0R$ + +pg_catalog +pg_catalog +pg_opclassbcid7 +xmax0R$ + +pg_catalog +pg_catalog +pg_opclassbxid7 +cmin0R$ + +pg_catalog +pg_catalog +pg_opclassbcid7 +xmin0R$ + +pg_catalog +pg_catalog +pg_opclassbxid7 +ctid0R$ + +pg_catalog +pg_catalog +pg_opclassbtid6 +oid0R$ + +pg_catalog +pg_catalog +pg_opclassboid< + opcmethod0R$ + +pg_catalog +pg_catalog +pg_opclassboid; +opcname0@R$ + +pg_catalog +pg_catalog +pg_opclassbname? + opcnamespace0R$ + +pg_catalog +pg_catalog +pg_opclassboid; +opcowner0R$ + +pg_catalog +pg_catalog +pg_opclassboid< + opcfamily0R$ + +pg_catalog +pg_catalog +pg_opclassboid< + opcintype0R$ + +pg_catalog +pg_catalog +pg_opclassboid> + +opcdefault0R$ + +pg_catalog +pg_catalog +pg_opclassbbool= + +opckeytype0R$ + +pg_catalog +pg_catalog +pg_opclassboid· + +% + +pg_catalog +pg_catalog pg_operator< +tableoid0R% + +pg_catalog +pg_catalog pg_operatorboid8 +cmax0R% + +pg_catalog +pg_catalog pg_operatorbcid8 +xmax0R% + +pg_catalog +pg_catalog pg_operatorbxid8 +cmin0R% + +pg_catalog +pg_catalog pg_operatorbcid8 +xmin0R% + +pg_catalog +pg_catalog pg_operatorbxid8 +ctid0R% + +pg_catalog +pg_catalog pg_operatorbtid7 +oid0R% + +pg_catalog +pg_catalog pg_operatorboid< +oprname0@R% + +pg_catalog +pg_catalog pg_operatorbname@ + oprnamespace0R% + +pg_catalog +pg_catalog pg_operatorboid< +oprowner0R% + +pg_catalog +pg_catalog pg_operatorboid< +oprkind0R% + +pg_catalog +pg_catalog pg_operatorbchar@ + oprcanmerge0R% + +pg_catalog +pg_catalog pg_operatorbbool? + +oprcanhash0R% + +pg_catalog +pg_catalog pg_operatorbbool; +oprleft0R% + +pg_catalog +pg_catalog pg_operatorboid< +oprright0R% + +pg_catalog +pg_catalog pg_operatorboid= + oprresult0R% + +pg_catalog +pg_catalog pg_operatorboid: +oprcom0R% + +pg_catalog +pg_catalog pg_operatorboid= + oprnegate0R% + +pg_catalog +pg_catalog pg_operatorboid? +oprcode0R% + +pg_catalog +pg_catalog pg_operatorb regproc? +oprrest0R% + +pg_catalog +pg_catalog pg_operatorb regproc? +oprjoin0R% + +pg_catalog +pg_catalog pg_operatorb regproc½ +% + +pg_catalog +pg_catalog pg_opfamily< +tableoid0R% + +pg_catalog +pg_catalog pg_opfamilyboid8 +cmax0R% + +pg_catalog +pg_catalog pg_opfamilybcid8 +xmax0R% + +pg_catalog +pg_catalog pg_opfamilybxid8 +cmin0R% + +pg_catalog +pg_catalog pg_opfamilybcid8 +xmin0R% + +pg_catalog +pg_catalog pg_opfamilybxid8 +ctid0R% + +pg_catalog +pg_catalog pg_opfamilybtid7 +oid0R% + +pg_catalog +pg_catalog pg_opfamilyboid= + opfmethod0R% + +pg_catalog +pg_catalog pg_opfamilyboid< +opfname0@R% + +pg_catalog +pg_catalog pg_opfamilybname@ + opfnamespace0R% + +pg_catalog +pg_catalog pg_opfamilyboid< +opfowner0R% + +pg_catalog +pg_catalog pg_opfamilyboidƒ +* + +pg_catalog +pg_catalogpg_parameter_aclA +tableoid0R* + +pg_catalog +pg_catalogpg_parameter_aclboid= +cmax0R* + +pg_catalog +pg_catalogpg_parameter_aclbcid= +xmax0R* + +pg_catalog +pg_catalogpg_parameter_aclbxid= +cmin0R* + +pg_catalog +pg_catalogpg_parameter_aclbcid= +xmin0R* + +pg_catalog +pg_catalogpg_parameter_aclbxid= +ctid0R* + +pg_catalog +pg_catalogpg_parameter_aclbtid< +oid0R* + +pg_catalog +pg_catalogpg_parameter_aclboidJ +parname0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_parameter_aclbtextM +paracl 0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_parameter_aclb +_aclitemÐ +. + +pg_catalog +pg_catalogpg_partitioned_tableE +tableoid0R. + +pg_catalog +pg_catalogpg_partitioned_tableboidA +cmax0R. + +pg_catalog +pg_catalogpg_partitioned_tablebcidA +xmax0R. + +pg_catalog +pg_catalogpg_partitioned_tablebxidA +cmin0R. + +pg_catalog +pg_catalogpg_partitioned_tablebcidA +xmin0R. + +pg_catalog +pg_catalogpg_partitioned_tablebxidA +ctid0R. + +pg_catalog +pg_catalogpg_partitioned_tablebtidF + partrelid0R. + +pg_catalog +pg_catalogpg_partitioned_tableboidG + partstrat0R. + +pg_catalog +pg_catalogpg_partitioned_tablebcharG + partnatts0R. + +pg_catalog +pg_catalogpg_partitioned_tablebint2F + partdefid0R. + +pg_catalog +pg_catalogpg_partitioned_tableboidX + partattrs 0ÿÿÿÿÿÿÿÿÿR. + +pg_catalog +pg_catalogpg_partitioned_tableb  +int2vectorW + partclass 0ÿÿÿÿÿÿÿÿÿR. + +pg_catalog +pg_catalogpg_partitioned_tableb  oidvector[ + partcollation 0ÿÿÿÿÿÿÿÿÿR. + +pg_catalog +pg_catalogpg_partitioned_tableb  oidvectorV + partexprs0ÿÿÿÿÿÿÿÿÿR. + +pg_catalog +pg_catalogpg_partitioned_tableb pg_node_tree¼ +% + +pg_catalog +pg_catalog pg_policies= + +schemaname0@R% + +pg_catalog +pg_catalog pg_policiesbname< + tablename0@R% + +pg_catalog +pg_catalog pg_policiesbname= + +policyname0@R% + +pg_catalog +pg_catalog pg_policiesbnameF + +permissive0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_policiesbtextD +roles 0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_policiesb_name? +cmd0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_policiesbtext@ +qual0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_policiesbtextF + +with_check0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_policiesbtextˆ +# + +pg_catalog +pg_catalog pg_policy: +tableoid0R# + +pg_catalog +pg_catalog pg_policyboid6 +cmax0R# + +pg_catalog +pg_catalog pg_policybcid6 +xmax0R# + +pg_catalog +pg_catalog pg_policybxid6 +cmin0R# + +pg_catalog +pg_catalog pg_policybcid6 +xmin0R# + +pg_catalog +pg_catalog pg_policybxid6 +ctid0R# + +pg_catalog +pg_catalog pg_policybtid5 +oid0R# + +pg_catalog +pg_catalog pg_policyboid: +polname0@R# + +pg_catalog +pg_catalog pg_policybname: +polrelid0R# + +pg_catalog +pg_catalog pg_policyboid9 +polcmd0R# + +pg_catalog +pg_catalog pg_policybchar@ + polpermissive0R# + +pg_catalog +pg_catalog pg_policybboolF +polroles 0ÿÿÿÿÿÿÿÿÿR# + +pg_catalog +pg_catalog pg_policyb_oidI +polqual0ÿÿÿÿÿÿÿÿÿR# + +pg_catalog +pg_catalog pg_policyb pg_node_treeN + polwithcheck0ÿÿÿÿÿÿÿÿÿR# + +pg_catalog +pg_catalog pg_policyb pg_node_treeã +0 + +pg_catalog +pg_catalogpg_prepared_statementsK +name0ÿÿÿÿÿÿÿÿÿR0 + +pg_catalog +pg_catalogpg_prepared_statementsbtextP + statement0ÿÿÿÿÿÿÿÿÿR0 + +pg_catalog +pg_catalogpg_prepared_statementsbtextQ + prepare_time0R0 + +pg_catalog +pg_catalogpg_prepared_statementsb  timestamptz\ +parameter_types 0ÿÿÿÿÿÿÿÿÿR0 + +pg_catalog +pg_catalogpg_prepared_statementsb +_regtypeF +from_sql0R0 + +pg_catalog +pg_catalogpg_prepared_statementsbboolK + generic_plans0R0 + +pg_catalog +pg_catalogpg_prepared_statementsbint8J + custom_plans0R0 + +pg_catalog +pg_catalogpg_prepared_statementsbint8† ++ + +pg_catalog +pg_catalogpg_prepared_xactsC + transaction0R+ + +pg_catalog +pg_catalogpg_prepared_xactsbxidE +gid0ÿÿÿÿÿÿÿÿÿR+ + +pg_catalog +pg_catalogpg_prepared_xactsbtextH +prepared0R+ + +pg_catalog +pg_catalogpg_prepared_xactsb  timestamptz> +owner0@R+ + +pg_catalog +pg_catalogpg_prepared_xactsbnameA +database0@R+ + +pg_catalog +pg_catalogpg_prepared_xactsbnameý +! + +pg_catalog +pg_catalogpg_proc8 +tableoid0R! + +pg_catalog +pg_catalogpg_procboid4 +cmax0R! + +pg_catalog +pg_catalogpg_procbcid4 +xmax0R! + +pg_catalog +pg_catalogpg_procbxid4 +cmin0R! + +pg_catalog +pg_catalogpg_procbcid4 +xmin0R! + +pg_catalog +pg_catalogpg_procbxid4 +ctid0R! + +pg_catalog +pg_catalogpg_procbtid3 +oid0R! + +pg_catalog +pg_catalogpg_procboid8 +proname0@R! + +pg_catalog +pg_catalogpg_procbname< + pronamespace0R! + +pg_catalog +pg_catalogpg_procboid8 +proowner0R! + +pg_catalog +pg_catalogpg_procboid7 +prolang0R! + +pg_catalog +pg_catalogpg_procboid: +procost0R! + +pg_catalog +pg_catalogpg_procbfloat4: +prorows0R! + +pg_catalog +pg_catalogpg_procbfloat4; + provariadic0R! + +pg_catalog +pg_catalogpg_procboid> + +prosupport0R! + +pg_catalog +pg_catalogpg_procb regproc8 +prokind0R! + +pg_catalog +pg_catalogpg_procbchar: + prosecdef0R! + +pg_catalog +pg_catalogpg_procbbool= + proleakproof0R! + +pg_catalog +pg_catalogpg_procbbool< + proisstrict0R! + +pg_catalog +pg_catalogpg_procbbool: + proretset0R! + +pg_catalog +pg_catalogpg_procbbool< + provolatile0R! + +pg_catalog +pg_catalogpg_procbchar< + proparallel0R! + +pg_catalog +pg_catalogpg_procbchar9 +pronargs0R! + +pg_catalog +pg_catalogpg_procbint2@ +pronargdefaults0R! + +pg_catalog +pg_catalogpg_procbint2: + +prorettype0R! + +pg_catalog +pg_catalogpg_procboidL + proargtypes 0ÿÿÿÿÿÿÿÿÿR! + +pg_catalog +pg_catalogpg_procb  oidvectorH +proallargtypes 0ÿÿÿÿÿÿÿÿÿR! + +pg_catalog +pg_catalogpg_procb_oidF + proargmodes 0ÿÿÿÿÿÿÿÿÿR! + +pg_catalog +pg_catalogpg_procb_charF + proargnames 0ÿÿÿÿÿÿÿÿÿR! + +pg_catalog +pg_catalogpg_procb_textN +proargdefaults0ÿÿÿÿÿÿÿÿÿR! + +pg_catalog +pg_catalogpg_procb pg_node_treeE + protrftypes 0ÿÿÿÿÿÿÿÿÿR! + +pg_catalog +pg_catalogpg_procb_oid@ +prosrc0ÿÿÿÿÿÿÿÿÿR! + +pg_catalog +pg_catalogpg_procbtext> +probin0ÿÿÿÿÿÿÿÿÿR! + +pg_catalog +pg_catalogpg_procbtextJ + +prosqlbody0ÿÿÿÿÿÿÿÿÿR! + +pg_catalog +pg_catalogpg_procb pg_node_treeD + proconfig 0ÿÿÿÿÿÿÿÿÿR! + +pg_catalog +pg_catalogpg_procb_textD +proacl 0ÿÿÿÿÿÿÿÿÿR! + +pg_catalog +pg_catalogpg_procb +_aclitemò +( + +pg_catalog +pg_catalogpg_publication? +tableoid0R( + +pg_catalog +pg_catalogpg_publicationboid; +cmax0R( + +pg_catalog +pg_catalogpg_publicationbcid; +xmax0R( + +pg_catalog +pg_catalogpg_publicationbxid; +cmin0R( + +pg_catalog +pg_catalogpg_publicationbcid; +xmin0R( + +pg_catalog +pg_catalogpg_publicationbxid; +ctid0R( + +pg_catalog +pg_catalogpg_publicationbtid: +oid0R( + +pg_catalog +pg_catalogpg_publicationboid? +pubname0@R( + +pg_catalog +pg_catalogpg_publicationbname? +pubowner0R( + +pg_catalog +pg_catalogpg_publicationboidD + puballtables0R( + +pg_catalog +pg_catalogpg_publicationbboolA + pubinsert0R( + +pg_catalog +pg_catalogpg_publicationbboolA + pubupdate0R( + +pg_catalog +pg_catalogpg_publicationbboolA + pubdelete0R( + +pg_catalog +pg_catalogpg_publicationbboolC + pubtruncate0R( + +pg_catalog +pg_catalogpg_publicationbboolB + +pubviaroot0R( + +pg_catalog +pg_catalogpg_publicationbbool¼ +2 + +pg_catalog +pg_catalogpg_publication_namespaceI +tableoid0R2 + +pg_catalog +pg_catalogpg_publication_namespaceboidE +cmax0R2 + +pg_catalog +pg_catalogpg_publication_namespacebcidE +xmax0R2 + +pg_catalog +pg_catalogpg_publication_namespacebxidE +cmin0R2 + +pg_catalog +pg_catalogpg_publication_namespacebcidE +xmin0R2 + +pg_catalog +pg_catalogpg_publication_namespacebxidE +ctid0R2 + +pg_catalog +pg_catalogpg_publication_namespacebtidD +oid0R2 + +pg_catalog +pg_catalogpg_publication_namespaceboidH +pnpubid0R2 + +pg_catalog +pg_catalogpg_publication_namespaceboidH +pnnspid0R2 + +pg_catalog +pg_catalogpg_publication_namespaceboid§ +, + +pg_catalog +pg_catalogpg_publication_relC +tableoid0R, + +pg_catalog +pg_catalogpg_publication_relboid? +cmax0R, + +pg_catalog +pg_catalogpg_publication_relbcid? +xmax0R, + +pg_catalog +pg_catalogpg_publication_relbxid? +cmin0R, + +pg_catalog +pg_catalogpg_publication_relbcid? +xmin0R, + +pg_catalog +pg_catalogpg_publication_relbxid? +ctid0R, + +pg_catalog +pg_catalogpg_publication_relbtid> +oid0R, + +pg_catalog +pg_catalogpg_publication_relboidB +prpubid0R, + +pg_catalog +pg_catalogpg_publication_relboidB +prrelid0R, + +pg_catalog +pg_catalogpg_publication_relboidQ +prqual0ÿÿÿÿÿÿÿÿÿR, + +pg_catalog +pg_catalogpg_publication_relb pg_node_treeR +prattrs 0ÿÿÿÿÿÿÿÿÿR, + +pg_catalog +pg_catalogpg_publication_relb  +int2vector¬ +/ + +pg_catalog +pg_catalogpg_publication_tablesD +pubname0@R/ + +pg_catalog +pg_catalogpg_publication_tablesbnameG + +schemaname0@R/ + +pg_catalog +pg_catalogpg_publication_tablesbnameF + tablename0@R/ + +pg_catalog +pg_catalogpg_publication_tablesbnameQ +attnames 0ÿÿÿÿÿÿÿÿÿR/ + +pg_catalog +pg_catalogpg_publication_tablesb_nameO + rowfilter0ÿÿÿÿÿÿÿÿÿR/ + +pg_catalog +pg_catalogpg_publication_tablesbtext© +" + +pg_catalog +pg_catalogpg_range9 +tableoid0R" + +pg_catalog +pg_catalogpg_rangeboid5 +cmax0R" + +pg_catalog +pg_catalogpg_rangebcid5 +xmax0R" + +pg_catalog +pg_catalogpg_rangebxid5 +cmin0R" + +pg_catalog +pg_catalogpg_rangebcid5 +xmin0R" + +pg_catalog +pg_catalogpg_rangebxid5 +ctid0R" + +pg_catalog +pg_catalogpg_rangebtid9 +rngtypid0R" + +pg_catalog +pg_catalogpg_rangeboid; + +rngsubtype0R" + +pg_catalog +pg_catalogpg_rangeboid> + rngmultitypid0R" + +pg_catalog +pg_catalogpg_rangeboid= + rngcollation0R" + +pg_catalog +pg_catalogpg_rangeboid: + rngsubopc0R" + +pg_catalog +pg_catalogpg_rangeboidA + rngcanonical0R" + +pg_catalog +pg_catalogpg_rangeb regproc? + +rngsubdiff0R" + +pg_catalog +pg_catalogpg_rangeb regprocä +/ + +pg_catalog +pg_catalogpg_replication_originF +tableoid0R/ + +pg_catalog +pg_catalogpg_replication_originboidB +cmax0R/ + +pg_catalog +pg_catalogpg_replication_originbcidB +xmax0R/ + +pg_catalog +pg_catalogpg_replication_originbxidB +cmin0R/ + +pg_catalog +pg_catalogpg_replication_originbcidB +xmin0R/ + +pg_catalog +pg_catalogpg_replication_originbxidB +ctid0R/ + +pg_catalog +pg_catalogpg_replication_originbtidE +roident0R/ + +pg_catalog +pg_catalogpg_replication_originboidN +roname0ÿÿÿÿÿÿÿÿÿR/ + +pg_catalog +pg_catalogpg_replication_originbtext‚ +6 + +pg_catalog +pg_catalogpg_replication_origin_statusK +local_id0R6 + +pg_catalog +pg_catalogpg_replication_origin_statusboidX + external_id0ÿÿÿÿÿÿÿÿÿR6 + +pg_catalog +pg_catalogpg_replication_origin_statusbtextP + +remote_lsn0R6 + +pg_catalog +pg_catalogpg_replication_origin_statusbpg_lsnO + local_lsn0R6 + +pg_catalog +pg_catalogpg_replication_origin_statusbpg_lsnò +. + +pg_catalog +pg_catalogpg_replication_slotsE + slot_name0@R. + +pg_catalog +pg_catalogpg_replication_slotsbnameB +plugin0@R. + +pg_catalog +pg_catalogpg_replication_slotsbnameN + slot_type0ÿÿÿÿÿÿÿÿÿR. + +pg_catalog +pg_catalogpg_replication_slotsbtextA +datoid0R. + +pg_catalog +pg_catalogpg_replication_slotsboidD +database0@R. + +pg_catalog +pg_catalogpg_replication_slotsbnameE + temporary0R. + +pg_catalog +pg_catalogpg_replication_slotsbboolB +active0R. + +pg_catalog +pg_catalogpg_replication_slotsbboolF + +active_pid0R. + +pg_catalog +pg_catalogpg_replication_slotsbint4? +xmin0R. + +pg_catalog +pg_catalogpg_replication_slotsbxidG + catalog_xmin0R. + +pg_catalog +pg_catalogpg_replication_slotsbxidI + restart_lsn0R. + +pg_catalog +pg_catalogpg_replication_slotsbpg_lsnQ +confirmed_flush_lsn0R. + +pg_catalog +pg_catalogpg_replication_slotsbpg_lsnO + +wal_status0ÿÿÿÿÿÿÿÿÿR. + +pg_catalog +pg_catalogpg_replication_slotsbtextI + safe_wal_size0R. + +pg_catalog +pg_catalogpg_replication_slotsbint8E + two_phase0R. + +pg_catalog +pg_catalogpg_replication_slotsbboolŽ +$ + +pg_catalog +pg_catalog +pg_rewrite; +tableoid0R$ + +pg_catalog +pg_catalog +pg_rewriteboid7 +cmax0R$ + +pg_catalog +pg_catalog +pg_rewritebcid7 +xmax0R$ + +pg_catalog +pg_catalog +pg_rewritebxid7 +cmin0R$ + +pg_catalog +pg_catalog +pg_rewritebcid7 +xmin0R$ + +pg_catalog +pg_catalog +pg_rewritebxid7 +ctid0R$ + +pg_catalog +pg_catalog +pg_rewritebtid6 +oid0R$ + +pg_catalog +pg_catalog +pg_rewriteboid< +rulename0@R$ + +pg_catalog +pg_catalog +pg_rewritebname; +ev_class0R$ + +pg_catalog +pg_catalog +pg_rewriteboid; +ev_type0R$ + +pg_catalog +pg_catalog +pg_rewritebchar> + +ev_enabled0R$ + +pg_catalog +pg_catalog +pg_rewritebchar> + +is_instead0R$ + +pg_catalog +pg_catalog +pg_rewritebboolL +ev_qual0ÿÿÿÿÿÿÿÿÿR$ + +pg_catalog +pg_catalog +pg_rewriteb pg_node_treeN + ev_action0ÿÿÿÿÿÿÿÿÿR$ + +pg_catalog +pg_catalog +pg_rewriteb pg_node_treeÏ +" + +pg_catalog +pg_catalogpg_roles7 +rolname0@R" + +pg_catalog +pg_catalogpg_rolesbname8 +rolsuper0R" + +pg_catalog +pg_catalogpg_rolesbbool: + +rolinherit0R" + +pg_catalog +pg_catalogpg_rolesbbool= + rolcreaterole0R" + +pg_catalog +pg_catalogpg_rolesbbool; + rolcreatedb0R" + +pg_catalog +pg_catalogpg_rolesbbool; + rolcanlogin0R" + +pg_catalog +pg_catalogpg_rolesbbool> +rolreplication0R" + +pg_catalog +pg_catalogpg_rolesbbool< + rolconnlimit0R" + +pg_catalog +pg_catalogpg_rolesbint4D + rolpassword0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_rolesbtextD + rolvaliduntil0R" + +pg_catalog +pg_catalogpg_rolesb  timestamptz< + rolbypassrls0R" + +pg_catalog +pg_catalogpg_rolesbboolE + rolconfig 0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_rolesb_text2 +oid0R" + +pg_catalog +pg_catalogpg_rolesboidš +" + +pg_catalog +pg_catalogpg_rules: + +schemaname0@R" + +pg_catalog +pg_catalogpg_rulesbname9 + tablename0@R" + +pg_catalog +pg_catalogpg_rulesbname8 +rulename0@R" + +pg_catalog +pg_catalogpg_rulesbnameC + +definition0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_rulesbtextÍ +% + +pg_catalog +pg_catalog pg_seclabel< +tableoid0R% + +pg_catalog +pg_catalog pg_seclabelboid8 +cmax0R% + +pg_catalog +pg_catalog pg_seclabelbcid8 +xmax0R% + +pg_catalog +pg_catalog pg_seclabelbxid8 +cmin0R% + +pg_catalog +pg_catalog pg_seclabelbcid8 +xmin0R% + +pg_catalog +pg_catalog pg_seclabelbxid8 +ctid0R% + +pg_catalog +pg_catalog pg_seclabelbtid: +objoid0R% + +pg_catalog +pg_catalog pg_seclabelboid< +classoid0R% + +pg_catalog +pg_catalog pg_seclabelboid= +objsubid0R% + +pg_catalog +pg_catalog pg_seclabelbint4F +provider0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_seclabelbtextC +label0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_seclabelbtext¶ +& + +pg_catalog +pg_catalog pg_seclabels9 +objoid0R& + +pg_catalog +pg_catalog pg_seclabelsboid; +classoid0R& + +pg_catalog +pg_catalog pg_seclabelsboid< +objsubid0R& + +pg_catalog +pg_catalog pg_seclabelsbint4D +objtype0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_seclabelsbtext? + objnamespace0R& + +pg_catalog +pg_catalog pg_seclabelsboidD +objname0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_seclabelsbtextE +provider0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_seclabelsbtextB +label0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_seclabelsbtextý +% + +pg_catalog +pg_catalog pg_sequence< +tableoid0R% + +pg_catalog +pg_catalog pg_sequenceboid8 +cmax0R% + +pg_catalog +pg_catalog pg_sequencebcid8 +xmax0R% + +pg_catalog +pg_catalog pg_sequencebxid8 +cmin0R% + +pg_catalog +pg_catalog pg_sequencebcid8 +xmin0R% + +pg_catalog +pg_catalog pg_sequencebxid8 +ctid0R% + +pg_catalog +pg_catalog pg_sequencebtid< +seqrelid0R% + +pg_catalog +pg_catalog pg_sequenceboid< +seqtypid0R% + +pg_catalog +pg_catalog pg_sequenceboid= +seqstart0R% + +pg_catalog +pg_catalog pg_sequencebint8A + seqincrement0R% + +pg_catalog +pg_catalog pg_sequencebint8; +seqmax0R% + +pg_catalog +pg_catalog pg_sequencebint8; +seqmin0R% + +pg_catalog +pg_catalog pg_sequencebint8= +seqcache0R% + +pg_catalog +pg_catalog pg_sequencebint8= +seqcycle0R% + +pg_catalog +pg_catalog pg_sequencebboolë +& + +pg_catalog +pg_catalog pg_sequences> + +schemaname0@R& + +pg_catalog +pg_catalog pg_sequencesbname@ + sequencename0@R& + +pg_catalog +pg_catalog pg_sequencesbnameA + sequenceowner0@R& + +pg_catalog +pg_catalog pg_sequencesbname@ + data_type0R& + +pg_catalog +pg_catalog pg_sequencesb regtype? + start_value0R& + +pg_catalog +pg_catalog pg_sequencesbint8= + min_value0R& + +pg_catalog +pg_catalog pg_sequencesbint8= + max_value0R& + +pg_catalog +pg_catalog pg_sequencesbint8@ + increment_by0R& + +pg_catalog +pg_catalog pg_sequencesbint89 +cycle0R& + +pg_catalog +pg_catalog pg_sequencesbbool> + +cache_size0R& + +pg_catalog +pg_catalog pg_sequencesbint8> + +last_value0R& + +pg_catalog +pg_catalog pg_sequencesbint8¿ +% + +pg_catalog +pg_catalog pg_settings@ +name0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_settingsbtextC +setting0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_settingsbtext@ +unit0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_settingsbtextD +category0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_settingsbtextF + +short_desc0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_settingsbtextF + +extra_desc0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_settingsbtextC +context0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_settingsbtextC +vartype0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_settingsbtextB +source0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_settingsbtextC +min_val0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_settingsbtextC +max_val0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_settingsbtextG +enumvals 0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_settingsb_textD +boot_val0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_settingsbtextE + reset_val0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_settingsbtextF + +sourcefile0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_settingsbtext= + +sourceline0R% + +pg_catalog +pg_catalog pg_settingsbint4B +pending_restart0R% + +pg_catalog +pg_catalog pg_settingsbbool× +# + +pg_catalog +pg_catalog pg_shadow8 +usename0@R# + +pg_catalog +pg_catalog pg_shadowbname8 +usesysid0R# + +pg_catalog +pg_catalog pg_shadowboid< + usecreatedb0R# + +pg_catalog +pg_catalog pg_shadowbbool9 +usesuper0R# + +pg_catalog +pg_catalog pg_shadowbbool8 +userepl0R# + +pg_catalog +pg_catalog pg_shadowbbool= + usebypassrls0R# + +pg_catalog +pg_catalog pg_shadowbbool@ +passwd0ÿÿÿÿÿÿÿÿÿR# + +pg_catalog +pg_catalog pg_shadowbtext@ +valuntil0R# + +pg_catalog +pg_catalog pg_shadowb  timestamptzF + useconfig 0ÿÿÿÿÿÿÿÿÿR# + +pg_catalog +pg_catalog pg_shadowb_text´ +% + +pg_catalog +pg_catalog pg_shdepend< +tableoid0R% + +pg_catalog +pg_catalog pg_shdependboid8 +cmax0R% + +pg_catalog +pg_catalog pg_shdependbcid8 +xmax0R% + +pg_catalog +pg_catalog pg_shdependbxid8 +cmin0R% + +pg_catalog +pg_catalog pg_shdependbcid8 +xmin0R% + +pg_catalog +pg_catalog pg_shdependbxid8 +ctid0R% + +pg_catalog +pg_catalog pg_shdependbtid8 +dbid0R% + +pg_catalog +pg_catalog pg_shdependboid; +classid0R% + +pg_catalog +pg_catalog pg_shdependboid9 +objid0R% + +pg_catalog +pg_catalog pg_shdependboid= +objsubid0R% + +pg_catalog +pg_catalog pg_shdependbint4> + +refclassid0R% + +pg_catalog +pg_catalog pg_shdependboid< +refobjid0R% + +pg_catalog +pg_catalog pg_shdependboid< +deptype0R% + +pg_catalog +pg_catalog pg_shdependbcharþ +* + +pg_catalog +pg_catalogpg_shdescriptionA +tableoid0R* + +pg_catalog +pg_catalogpg_shdescriptionboid= +cmax0R* + +pg_catalog +pg_catalogpg_shdescriptionbcid= +xmax0R* + +pg_catalog +pg_catalogpg_shdescriptionbxid= +cmin0R* + +pg_catalog +pg_catalogpg_shdescriptionbcid= +xmin0R* + +pg_catalog +pg_catalogpg_shdescriptionbxid= +ctid0R* + +pg_catalog +pg_catalogpg_shdescriptionbtid? +objoid0R* + +pg_catalog +pg_catalogpg_shdescriptionboidA +classoid0R* + +pg_catalog +pg_catalogpg_shdescriptionboidN + description0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_shdescriptionbtextÊ +. + +pg_catalog +pg_catalogpg_shmem_allocationsI +name0ÿÿÿÿÿÿÿÿÿR. + +pg_catalog +pg_catalogpg_shmem_allocationsbtext? +off0R. + +pg_catalog +pg_catalogpg_shmem_allocationsbint8@ +size0R. + +pg_catalog +pg_catalogpg_shmem_allocationsbint8J +allocated_size0R. + +pg_catalog +pg_catalogpg_shmem_allocationsbint8¤ +' + +pg_catalog +pg_catalog pg_shseclabel> +tableoid0R' + +pg_catalog +pg_catalog pg_shseclabelboid: +cmax0R' + +pg_catalog +pg_catalog pg_shseclabelbcid: +xmax0R' + +pg_catalog +pg_catalog pg_shseclabelbxid: +cmin0R' + +pg_catalog +pg_catalog pg_shseclabelbcid: +xmin0R' + +pg_catalog +pg_catalog pg_shseclabelbxid: +ctid0R' + +pg_catalog +pg_catalog pg_shseclabelbtid< +objoid0R' + +pg_catalog +pg_catalog pg_shseclabelboid> +classoid0R' + +pg_catalog +pg_catalog pg_shseclabelboidH +provider0ÿÿÿÿÿÿÿÿÿR' + +pg_catalog +pg_catalog pg_shseclabelbtextE +label0ÿÿÿÿÿÿÿÿÿR' + +pg_catalog +pg_catalog pg_shseclabelbtextá +* + +pg_catalog +pg_catalogpg_stat_activity< +datid0R* + +pg_catalog +pg_catalogpg_stat_activityboid? +datname0@R* + +pg_catalog +pg_catalogpg_stat_activitybname; +pid0R* + +pg_catalog +pg_catalogpg_stat_activitybint4B + +leader_pid0R* + +pg_catalog +pg_catalogpg_stat_activitybint4? +usesysid0R* + +pg_catalog +pg_catalogpg_stat_activityboid? +usename0@R* + +pg_catalog +pg_catalogpg_stat_activitybnameQ +application_name0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_stat_activitybtextL + client_addr0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_stat_activitybinetP +client_hostname0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_stat_activitybtextC + client_port0R* + +pg_catalog +pg_catalogpg_stat_activitybint4L + backend_start0R* + +pg_catalog +pg_catalogpg_stat_activityb  timestamptzI + +xact_start0R* + +pg_catalog +pg_catalogpg_stat_activityb  timestamptzJ + query_start0R* + +pg_catalog +pg_catalogpg_stat_activityb  timestamptzK + state_change0R* + +pg_catalog +pg_catalogpg_stat_activityb  timestamptzP +wait_event_type0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_stat_activitybtextK + +wait_event0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_stat_activitybtextF +state0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_stat_activitybtextB + backend_xid0R* + +pg_catalog +pg_catalogpg_stat_activitybxidC + backend_xmin0R* + +pg_catalog +pg_catalogpg_stat_activitybxid@ +query_id0R* + +pg_catalog +pg_catalogpg_stat_activitybint8F +query0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_stat_activitybtextM + backend_type0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_stat_activitybtextâ +- + +pg_catalog +pg_catalogpg_stat_all_indexes? +relid0R- + +pg_catalog +pg_catalogpg_stat_all_indexesboidD + +indexrelid0R- + +pg_catalog +pg_catalogpg_stat_all_indexesboidE + +schemaname0@R- + +pg_catalog +pg_catalogpg_stat_all_indexesbnameB +relname0@R- + +pg_catalog +pg_catalogpg_stat_all_indexesbnameG + indexrelname0@R- + +pg_catalog +pg_catalogpg_stat_all_indexesbnameC +idx_scan0R- + +pg_catalog +pg_catalogpg_stat_all_indexesbint8G + idx_tup_read0R- + +pg_catalog +pg_catalogpg_stat_all_indexesbint8H + idx_tup_fetch0R- + +pg_catalog +pg_catalogpg_stat_all_indexesbint8½ +, + +pg_catalog +pg_catalogpg_stat_all_tables> +relid0R, + +pg_catalog +pg_catalogpg_stat_all_tablesboidD + +schemaname0@R, + +pg_catalog +pg_catalogpg_stat_all_tablesbnameA +relname0@R, + +pg_catalog +pg_catalogpg_stat_all_tablesbnameB +seq_scan0R, + +pg_catalog +pg_catalogpg_stat_all_tablesbint8F + seq_tup_read0R, + +pg_catalog +pg_catalogpg_stat_all_tablesbint8B +idx_scan0R, + +pg_catalog +pg_catalogpg_stat_all_tablesbint8G + idx_tup_fetch0R, + +pg_catalog +pg_catalogpg_stat_all_tablesbint8C + n_tup_ins0R, + +pg_catalog +pg_catalogpg_stat_all_tablesbint8C + n_tup_upd0R, + +pg_catalog +pg_catalogpg_stat_all_tablesbint8C + n_tup_del0R, + +pg_catalog +pg_catalogpg_stat_all_tablesbint8G + n_tup_hot_upd0R, + +pg_catalog +pg_catalogpg_stat_all_tablesbint8D + +n_live_tup0R, + +pg_catalog +pg_catalogpg_stat_all_tablesbint8D + +n_dead_tup0R, + +pg_catalog +pg_catalogpg_stat_all_tablesbint8M +n_mod_since_analyze0R, + +pg_catalog +pg_catalogpg_stat_all_tablesbint8L +n_ins_since_vacuum0R, + +pg_catalog +pg_catalogpg_stat_all_tablesbint8L + last_vacuum0R, + +pg_catalog +pg_catalogpg_stat_all_tablesb  timestamptzP +last_autovacuum0R, + +pg_catalog +pg_catalogpg_stat_all_tablesb  timestamptzM + last_analyze0R, + +pg_catalog +pg_catalogpg_stat_all_tablesb  timestamptzQ +last_autoanalyze0R, + +pg_catalog +pg_catalogpg_stat_all_tablesb  timestamptzF + vacuum_count0R, + +pg_catalog +pg_catalogpg_stat_all_tablesbint8J +autovacuum_count0R, + +pg_catalog +pg_catalogpg_stat_all_tablesbint8G + analyze_count0R, + +pg_catalog +pg_catalogpg_stat_all_tablesbint8K +autoanalyze_count0R, + +pg_catalog +pg_catalogpg_stat_all_tablesbint8Ð +* + +pg_catalog +pg_catalogpg_stat_archiverF +archived_count0R* + +pg_catalog +pg_catalogpg_stat_archiverbint8R +last_archived_wal0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_stat_archiverbtextQ +last_archived_time0R* + +pg_catalog +pg_catalogpg_stat_archiverb  timestamptzD + failed_count0R* + +pg_catalog +pg_catalogpg_stat_archiverbint8P +last_failed_wal0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_stat_archiverbtextO +last_failed_time0R* + +pg_catalog +pg_catalogpg_stat_archiverb  timestamptzJ + stats_reset0R* + +pg_catalog +pg_catalogpg_stat_archiverb  timestamptzé +* + +pg_catalog +pg_catalogpg_stat_bgwriterI +checkpoints_timed0R* + +pg_catalog +pg_catalogpg_stat_bgwriterbint8G +checkpoints_req0R* + +pg_catalog +pg_catalogpg_stat_bgwriterbint8O +checkpoint_write_time0R* + +pg_catalog +pg_catalogpg_stat_bgwriterbfloat8N +checkpoint_sync_time0R* + +pg_catalog +pg_catalogpg_stat_bgwriterbfloat8J +buffers_checkpoint0R* + +pg_catalog +pg_catalogpg_stat_bgwriterbint8E + buffers_clean0R* + +pg_catalog +pg_catalogpg_stat_bgwriterbint8H +maxwritten_clean0R* + +pg_catalog +pg_catalogpg_stat_bgwriterbint8G +buffers_backend0R* + +pg_catalog +pg_catalogpg_stat_bgwriterbint8M +buffers_backend_fsync0R* + +pg_catalog +pg_catalogpg_stat_bgwriterbint8E + buffers_alloc0R* + +pg_catalog +pg_catalogpg_stat_bgwriterbint8J + stats_reset0R* + +pg_catalog +pg_catalogpg_stat_bgwriterb  timestamptzì +* + +pg_catalog +pg_catalogpg_stat_database< +datid0R* + +pg_catalog +pg_catalogpg_stat_databaseboid? +datname0@R* + +pg_catalog +pg_catalogpg_stat_databasebnameC + numbackends0R* + +pg_catalog +pg_catalogpg_stat_databasebint4C + xact_commit0R* + +pg_catalog +pg_catalogpg_stat_databasebint8E + xact_rollback0R* + +pg_catalog +pg_catalogpg_stat_databasebint8A + blks_read0R* + +pg_catalog +pg_catalogpg_stat_databasebint8@ +blks_hit0R* + +pg_catalog +pg_catalogpg_stat_databasebint8D + tup_returned0R* + +pg_catalog +pg_catalogpg_stat_databasebint8C + tup_fetched0R* + +pg_catalog +pg_catalogpg_stat_databasebint8D + tup_inserted0R* + +pg_catalog +pg_catalogpg_stat_databasebint8C + tup_updated0R* + +pg_catalog +pg_catalogpg_stat_databasebint8C + tup_deleted0R* + +pg_catalog +pg_catalogpg_stat_databasebint8A + conflicts0R* + +pg_catalog +pg_catalogpg_stat_databasebint8B + +temp_files0R* + +pg_catalog +pg_catalogpg_stat_databasebint8B + +temp_bytes0R* + +pg_catalog +pg_catalogpg_stat_databasebint8A + deadlocks0R* + +pg_catalog +pg_catalogpg_stat_databasebint8I +checksum_failures0R* + +pg_catalog +pg_catalogpg_stat_databasebint8T +checksum_last_failure0R* + +pg_catalog +pg_catalogpg_stat_databaseb  timestamptzG + blk_read_time0R* + +pg_catalog +pg_catalogpg_stat_databasebfloat8H +blk_write_time0R* + +pg_catalog +pg_catalogpg_stat_databasebfloat8F + session_time0R* + +pg_catalog +pg_catalogpg_stat_databasebfloat8E + active_time0R* + +pg_catalog +pg_catalogpg_stat_databasebfloat8R +idle_in_transaction_time0R* + +pg_catalog +pg_catalogpg_stat_databasebfloat8@ +sessions0R* + +pg_catalog +pg_catalogpg_stat_databasebint8J +sessions_abandoned0R* + +pg_catalog +pg_catalogpg_stat_databasebint8F +sessions_fatal0R* + +pg_catalog +pg_catalogpg_stat_databasebint8G +sessions_killed0R* + +pg_catalog +pg_catalogpg_stat_databasebint8J + stats_reset0R* + +pg_catalog +pg_catalogpg_stat_databaseb  timestamptzâ +4 + +pg_catalog +pg_catalogpg_stat_database_conflictsF +datid0R4 + +pg_catalog +pg_catalogpg_stat_database_conflictsboidI +datname0@R4 + +pg_catalog +pg_catalogpg_stat_database_conflictsbnameR +confl_tablespace0R4 + +pg_catalog +pg_catalogpg_stat_database_conflictsbint8L + +confl_lock0R4 + +pg_catalog +pg_catalogpg_stat_database_conflictsbint8P +confl_snapshot0R4 + +pg_catalog +pg_catalogpg_stat_database_conflictsbint8Q +confl_bufferpin0R4 + +pg_catalog +pg_catalogpg_stat_database_conflictsbint8P +confl_deadlock0R4 + +pg_catalog +pg_catalogpg_stat_database_conflictsbint8¹ +( + +pg_catalog +pg_catalogpg_stat_gssapi9 +pid0R( + +pg_catalog +pg_catalogpg_stat_gssapibint4G +gss_authenticated0R( + +pg_catalog +pg_catalogpg_stat_gssapibboolH + principal0ÿÿÿÿÿÿÿÿÿR( + +pg_catalog +pg_catalogpg_stat_gssapibtext? + encrypted0R( + +pg_catalog +pg_catalogpg_stat_gssapibboolì +2 + +pg_catalog +pg_catalogpg_stat_progress_analyzeC +pid0R2 + +pg_catalog +pg_catalogpg_stat_progress_analyzebint4D +datid0R2 + +pg_catalog +pg_catalogpg_stat_progress_analyzeboidG +datname0@R2 + +pg_catalog +pg_catalogpg_stat_progress_analyzebnameD +relid0R2 + +pg_catalog +pg_catalogpg_stat_progress_analyzeboidN +phase0ÿÿÿÿÿÿÿÿÿR2 + +pg_catalog +pg_catalogpg_stat_progress_analyzebtextQ +sample_blks_total0R2 + +pg_catalog +pg_catalogpg_stat_progress_analyzebint8S +sample_blks_scanned0R2 + +pg_catalog +pg_catalogpg_stat_progress_analyzebint8O +ext_stats_total0R2 + +pg_catalog +pg_catalogpg_stat_progress_analyzebint8R +ext_stats_computed0R2 + +pg_catalog +pg_catalogpg_stat_progress_analyzebint8R +child_tables_total0R2 + +pg_catalog +pg_catalogpg_stat_progress_analyzebint8Q +child_tables_done0R2 + +pg_catalog +pg_catalogpg_stat_progress_analyzebint8X +current_child_table_relid0R2 + +pg_catalog +pg_catalogpg_stat_progress_analyzeboid¦ +5 + +pg_catalog +pg_catalogpg_stat_progress_basebackupF +pid0R5 + +pg_catalog +pg_catalogpg_stat_progress_basebackupbint4Q +phase0ÿÿÿÿÿÿÿÿÿR5 + +pg_catalog +pg_catalogpg_stat_progress_basebackupbtextO + backup_total0R5 + +pg_catalog +pg_catalogpg_stat_progress_basebackupbint8R +backup_streamed0R5 + +pg_catalog +pg_catalogpg_stat_progress_basebackupbint8T +tablespaces_total0R5 + +pg_catalog +pg_catalogpg_stat_progress_basebackupbint8W +tablespaces_streamed0R5 + +pg_catalog +pg_catalogpg_stat_progress_basebackupbint8ç +2 + +pg_catalog +pg_catalogpg_stat_progress_clusterC +pid0R2 + +pg_catalog +pg_catalogpg_stat_progress_clusterbint4D +datid0R2 + +pg_catalog +pg_catalogpg_stat_progress_clusterboidG +datname0@R2 + +pg_catalog +pg_catalogpg_stat_progress_clusterbnameD +relid0R2 + +pg_catalog +pg_catalogpg_stat_progress_clusterboidP +command0ÿÿÿÿÿÿÿÿÿR2 + +pg_catalog +pg_catalogpg_stat_progress_clusterbtextN +phase0ÿÿÿÿÿÿÿÿÿR2 + +pg_catalog +pg_catalogpg_stat_progress_clusterbtextR +cluster_index_relid0R2 + +pg_catalog +pg_catalogpg_stat_progress_clusterboidS +heap_tuples_scanned0R2 + +pg_catalog +pg_catalogpg_stat_progress_clusterbint8S +heap_tuples_written0R2 + +pg_catalog +pg_catalogpg_stat_progress_clusterbint8O +heap_blks_total0R2 + +pg_catalog +pg_catalogpg_stat_progress_clusterbint8Q +heap_blks_scanned0R2 + +pg_catalog +pg_catalogpg_stat_progress_clusterbint8S +index_rebuild_count0R2 + +pg_catalog +pg_catalogpg_stat_progress_clusterbint8 +/ + +pg_catalog +pg_catalogpg_stat_progress_copy@ +pid0R/ + +pg_catalog +pg_catalogpg_stat_progress_copybint4A +datid0R/ + +pg_catalog +pg_catalogpg_stat_progress_copyboidD +datname0@R/ + +pg_catalog +pg_catalogpg_stat_progress_copybnameA +relid0R/ + +pg_catalog +pg_catalogpg_stat_progress_copyboidM +command0ÿÿÿÿÿÿÿÿÿR/ + +pg_catalog +pg_catalogpg_stat_progress_copybtextJ +type0ÿÿÿÿÿÿÿÿÿR/ + +pg_catalog +pg_catalogpg_stat_progress_copybtextL +bytes_processed0R/ + +pg_catalog +pg_catalogpg_stat_progress_copybint8H + bytes_total0R/ + +pg_catalog +pg_catalogpg_stat_progress_copybint8M +tuples_processed0R/ + +pg_catalog +pg_catalogpg_stat_progress_copybint8L +tuples_excluded0R/ + +pg_catalog +pg_catalogpg_stat_progress_copybint8Û + +7 + +pg_catalog +pg_catalogpg_stat_progress_create_indexH +pid0R7 + +pg_catalog +pg_catalogpg_stat_progress_create_indexbint4I +datid0R7 + +pg_catalog +pg_catalogpg_stat_progress_create_indexboidL +datname0@R7 + +pg_catalog +pg_catalogpg_stat_progress_create_indexbnameI +relid0R7 + +pg_catalog +pg_catalogpg_stat_progress_create_indexboidO + index_relid0R7 + +pg_catalog +pg_catalogpg_stat_progress_create_indexboidU +command0ÿÿÿÿÿÿÿÿÿR7 + +pg_catalog +pg_catalogpg_stat_progress_create_indexbtextS +phase0ÿÿÿÿÿÿÿÿÿR7 + +pg_catalog +pg_catalogpg_stat_progress_create_indexbtextR + lockers_total0R7 + +pg_catalog +pg_catalogpg_stat_progress_create_indexbint8Q + lockers_done0R7 + +pg_catalog +pg_catalogpg_stat_progress_create_indexbint8W +current_locker_pid0R7 + +pg_catalog +pg_catalogpg_stat_progress_create_indexbint8Q + blocks_total0R7 + +pg_catalog +pg_catalogpg_stat_progress_create_indexbint8P + blocks_done0R7 + +pg_catalog +pg_catalogpg_stat_progress_create_indexbint8Q + tuples_total0R7 + +pg_catalog +pg_catalogpg_stat_progress_create_indexbint8P + tuples_done0R7 + +pg_catalog +pg_catalogpg_stat_progress_create_indexbint8U +partitions_total0R7 + +pg_catalog +pg_catalogpg_stat_progress_create_indexbint8T +partitions_done0R7 + +pg_catalog +pg_catalogpg_stat_progress_create_indexbint8€ +1 + +pg_catalog +pg_catalogpg_stat_progress_vacuumB +pid0R1 + +pg_catalog +pg_catalogpg_stat_progress_vacuumbint4C +datid0R1 + +pg_catalog +pg_catalogpg_stat_progress_vacuumboidF +datname0@R1 + +pg_catalog +pg_catalogpg_stat_progress_vacuumbnameC +relid0R1 + +pg_catalog +pg_catalogpg_stat_progress_vacuumboidM +phase0ÿÿÿÿÿÿÿÿÿR1 + +pg_catalog +pg_catalogpg_stat_progress_vacuumbtextN +heap_blks_total0R1 + +pg_catalog +pg_catalogpg_stat_progress_vacuumbint8P +heap_blks_scanned0R1 + +pg_catalog +pg_catalogpg_stat_progress_vacuumbint8Q +heap_blks_vacuumed0R1 + +pg_catalog +pg_catalogpg_stat_progress_vacuumbint8Q +index_vacuum_count0R1 + +pg_catalog +pg_catalogpg_stat_progress_vacuumbint8N +max_dead_tuples0R1 + +pg_catalog +pg_catalogpg_stat_progress_vacuumbint8N +num_dead_tuples0R1 + +pg_catalog +pg_catalogpg_stat_progress_vacuumbint8³ +3 + +pg_catalog +pg_catalogpg_stat_recovery_prefetchS + stats_reset0R3 + +pg_catalog +pg_catalogpg_stat_recovery_prefetchb  timestamptzI +prefetch0R3 + +pg_catalog +pg_catalogpg_stat_recovery_prefetchbint8D +hit0R3 + +pg_catalog +pg_catalogpg_stat_recovery_prefetchbint8J + skip_init0R3 + +pg_catalog +pg_catalogpg_stat_recovery_prefetchbint8I +skip_new0R3 + +pg_catalog +pg_catalogpg_stat_recovery_prefetchbint8I +skip_fpw0R3 + +pg_catalog +pg_catalogpg_stat_recovery_prefetchbint8I +skip_rep0R3 + +pg_catalog +pg_catalogpg_stat_recovery_prefetchbint8M + wal_distance0R3 + +pg_catalog +pg_catalogpg_stat_recovery_prefetchbint4O +block_distance0R3 + +pg_catalog +pg_catalogpg_stat_recovery_prefetchbint4I +io_depth0R3 + +pg_catalog +pg_catalogpg_stat_recovery_prefetchbint4† +- + +pg_catalog +pg_catalogpg_stat_replication> +pid0R- + +pg_catalog +pg_catalogpg_stat_replicationbint4B +usesysid0R- + +pg_catalog +pg_catalogpg_stat_replicationboidB +usename0@R- + +pg_catalog +pg_catalogpg_stat_replicationbnameT +application_name0ÿÿÿÿÿÿÿÿÿR- + +pg_catalog +pg_catalogpg_stat_replicationbtextO + client_addr0ÿÿÿÿÿÿÿÿÿR- + +pg_catalog +pg_catalogpg_stat_replicationbinetS +client_hostname0ÿÿÿÿÿÿÿÿÿR- + +pg_catalog +pg_catalogpg_stat_replicationbtextF + client_port0R- + +pg_catalog +pg_catalogpg_stat_replicationbint4O + backend_start0R- + +pg_catalog +pg_catalogpg_stat_replicationb  timestamptzF + backend_xmin0R- + +pg_catalog +pg_catalogpg_stat_replicationbxidI +state0ÿÿÿÿÿÿÿÿÿR- + +pg_catalog +pg_catalogpg_stat_replicationbtextE +sent_lsn0R- + +pg_catalog +pg_catalogpg_stat_replicationbpg_lsnF + write_lsn0R- + +pg_catalog +pg_catalogpg_stat_replicationbpg_lsnF + flush_lsn0R- + +pg_catalog +pg_catalogpg_stat_replicationbpg_lsnG + +replay_lsn0R- + +pg_catalog +pg_catalogpg_stat_replicationbpg_lsnH + write_lag0R- + +pg_catalog +pg_catalogpg_stat_replicationb +intervalH + flush_lag0R- + +pg_catalog +pg_catalogpg_stat_replicationb +intervalI + +replay_lag0R- + +pg_catalog +pg_catalogpg_stat_replicationb +intervalH + sync_priority0R- + +pg_catalog +pg_catalogpg_stat_replicationbint4N + +sync_state0ÿÿÿÿÿÿÿÿÿR- + +pg_catalog +pg_catalogpg_stat_replicationbtextL + +reply_time0R- + +pg_catalog +pg_catalogpg_stat_replicationb  timestamptzÏ +3 + +pg_catalog +pg_catalogpg_stat_replication_slotsS + slot_name0ÿÿÿÿÿÿÿÿÿR3 + +pg_catalog +pg_catalogpg_stat_replication_slotsbtextK + +spill_txns0R3 + +pg_catalog +pg_catalogpg_stat_replication_slotsbint8L + spill_count0R3 + +pg_catalog +pg_catalogpg_stat_replication_slotsbint8L + spill_bytes0R3 + +pg_catalog +pg_catalogpg_stat_replication_slotsbint8L + stream_txns0R3 + +pg_catalog +pg_catalogpg_stat_replication_slotsbint8M + stream_count0R3 + +pg_catalog +pg_catalogpg_stat_replication_slotsbint8M + stream_bytes0R3 + +pg_catalog +pg_catalogpg_stat_replication_slotsbint8K + +total_txns0R3 + +pg_catalog +pg_catalogpg_stat_replication_slotsbint8L + total_bytes0R3 + +pg_catalog +pg_catalogpg_stat_replication_slotsbint8S + stats_reset0R3 + +pg_catalog +pg_catalogpg_stat_replication_slotsb  timestamptzð +& + +pg_catalog +pg_catalog pg_stat_slruA +name0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_stat_slrubtext? + blks_zeroed0R& + +pg_catalog +pg_catalog pg_stat_slrubint8< +blks_hit0R& + +pg_catalog +pg_catalog pg_stat_slrubint8= + blks_read0R& + +pg_catalog +pg_catalog pg_stat_slrubint8@ + blks_written0R& + +pg_catalog +pg_catalog pg_stat_slrubint8? + blks_exists0R& + +pg_catalog +pg_catalog pg_stat_slrubint8; +flushes0R& + +pg_catalog +pg_catalog pg_stat_slrubint8= + truncates0R& + +pg_catalog +pg_catalog pg_stat_slrubint8F + stats_reset0R& + +pg_catalog +pg_catalog pg_stat_slrub  timestamptzµ +% + +pg_catalog +pg_catalog pg_stat_ssl6 +pid0R% + +pg_catalog +pg_catalog pg_stat_sslbint46 +ssl0R% + +pg_catalog +pg_catalog pg_stat_sslbboolC +version0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_stat_sslbtextB +cipher0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_stat_sslbtext7 +bits0R% + +pg_catalog +pg_catalog pg_stat_sslbint4E + client_dn0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_stat_sslbtextL + client_serial0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_stat_sslb numericE + issuer_dn0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_stat_sslbtextÙ +. + +pg_catalog +pg_catalogpg_stat_subscription@ +subid0R. + +pg_catalog +pg_catalogpg_stat_subscriptionboidC +subname0@R. + +pg_catalog +pg_catalogpg_stat_subscriptionbname? +pid0R. + +pg_catalog +pg_catalogpg_stat_subscriptionbint4@ +relid0R. + +pg_catalog +pg_catalogpg_stat_subscriptionboidJ + received_lsn0R. + +pg_catalog +pg_catalogpg_stat_subscriptionbpg_lsnU +last_msg_send_time0R. + +pg_catalog +pg_catalogpg_stat_subscriptionb  timestamptzX +last_msg_receipt_time0R. + +pg_catalog +pg_catalogpg_stat_subscriptionb  timestamptzL +latest_end_lsn0R. + +pg_catalog +pg_catalogpg_stat_subscriptionbpg_lsnR +latest_end_time0R. + +pg_catalog +pg_catalogpg_stat_subscriptionb  timestamptzÈ +4 + +pg_catalog +pg_catalogpg_stat_subscription_statsF +subid0R4 + +pg_catalog +pg_catalogpg_stat_subscription_statsboidI +subname0@R4 + +pg_catalog +pg_catalogpg_stat_subscription_statsbnameS +apply_error_count0R4 + +pg_catalog +pg_catalogpg_stat_subscription_statsbint8R +sync_error_count0R4 + +pg_catalog +pg_catalogpg_stat_subscription_statsbint8T + stats_reset0R4 + +pg_catalog +pg_catalogpg_stat_subscription_statsb  timestamptzâ +- + +pg_catalog +pg_catalogpg_stat_sys_indexes? +relid0R- + +pg_catalog +pg_catalogpg_stat_sys_indexesboidD + +indexrelid0R- + +pg_catalog +pg_catalogpg_stat_sys_indexesboidE + +schemaname0@R- + +pg_catalog +pg_catalogpg_stat_sys_indexesbnameB +relname0@R- + +pg_catalog +pg_catalogpg_stat_sys_indexesbnameG + indexrelname0@R- + +pg_catalog +pg_catalogpg_stat_sys_indexesbnameC +idx_scan0R- + +pg_catalog +pg_catalogpg_stat_sys_indexesbint8G + idx_tup_read0R- + +pg_catalog +pg_catalogpg_stat_sys_indexesbint8H + idx_tup_fetch0R- + +pg_catalog +pg_catalogpg_stat_sys_indexesbint8½ +, + +pg_catalog +pg_catalogpg_stat_sys_tables> +relid0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesboidD + +schemaname0@R, + +pg_catalog +pg_catalogpg_stat_sys_tablesbnameA +relname0@R, + +pg_catalog +pg_catalogpg_stat_sys_tablesbnameB +seq_scan0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesbint8F + seq_tup_read0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesbint8B +idx_scan0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesbint8G + idx_tup_fetch0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesbint8C + n_tup_ins0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesbint8C + n_tup_upd0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesbint8C + n_tup_del0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesbint8G + n_tup_hot_upd0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesbint8D + +n_live_tup0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesbint8D + +n_dead_tup0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesbint8M +n_mod_since_analyze0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesbint8L +n_ins_since_vacuum0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesbint8L + last_vacuum0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesb  timestamptzP +last_autovacuum0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesb  timestamptzM + last_analyze0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesb  timestamptzQ +last_autoanalyze0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesb  timestamptzF + vacuum_count0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesbint8J +autovacuum_count0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesbint8G + analyze_count0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesbint8K +autoanalyze_count0R, + +pg_catalog +pg_catalogpg_stat_sys_tablesbint8å +0 + +pg_catalog +pg_catalogpg_stat_user_functionsC +funcid0R0 + +pg_catalog +pg_catalogpg_stat_user_functionsboidH + +schemaname0@R0 + +pg_catalog +pg_catalogpg_stat_user_functionsbnameF +funcname0@R0 + +pg_catalog +pg_catalogpg_stat_user_functionsbnameC +calls0R0 + +pg_catalog +pg_catalogpg_stat_user_functionsbint8J + +total_time0R0 + +pg_catalog +pg_catalogpg_stat_user_functionsbfloat8I + self_time0R0 + +pg_catalog +pg_catalogpg_stat_user_functionsbfloat8ë +. + +pg_catalog +pg_catalogpg_stat_user_indexes@ +relid0R. + +pg_catalog +pg_catalogpg_stat_user_indexesboidE + +indexrelid0R. + +pg_catalog +pg_catalogpg_stat_user_indexesboidF + +schemaname0@R. + +pg_catalog +pg_catalogpg_stat_user_indexesbnameC +relname0@R. + +pg_catalog +pg_catalogpg_stat_user_indexesbnameH + indexrelname0@R. + +pg_catalog +pg_catalogpg_stat_user_indexesbnameD +idx_scan0R. + +pg_catalog +pg_catalogpg_stat_user_indexesbint8H + idx_tup_read0R. + +pg_catalog +pg_catalogpg_stat_user_indexesbint8I + idx_tup_fetch0R. + +pg_catalog +pg_catalogpg_stat_user_indexesbint8Õ +- + +pg_catalog +pg_catalogpg_stat_user_tables? +relid0R- + +pg_catalog +pg_catalogpg_stat_user_tablesboidE + +schemaname0@R- + +pg_catalog +pg_catalogpg_stat_user_tablesbnameB +relname0@R- + +pg_catalog +pg_catalogpg_stat_user_tablesbnameC +seq_scan0R- + +pg_catalog +pg_catalogpg_stat_user_tablesbint8G + seq_tup_read0R- + +pg_catalog +pg_catalogpg_stat_user_tablesbint8C +idx_scan0R- + +pg_catalog +pg_catalogpg_stat_user_tablesbint8H + idx_tup_fetch0R- + +pg_catalog +pg_catalogpg_stat_user_tablesbint8D + n_tup_ins0R- + +pg_catalog +pg_catalogpg_stat_user_tablesbint8D + n_tup_upd0R- + +pg_catalog +pg_catalogpg_stat_user_tablesbint8D + n_tup_del0R- + +pg_catalog +pg_catalogpg_stat_user_tablesbint8H + n_tup_hot_upd0R- + +pg_catalog +pg_catalogpg_stat_user_tablesbint8E + +n_live_tup0R- + +pg_catalog +pg_catalogpg_stat_user_tablesbint8E + +n_dead_tup0R- + +pg_catalog +pg_catalogpg_stat_user_tablesbint8N +n_mod_since_analyze0R- + +pg_catalog +pg_catalogpg_stat_user_tablesbint8M +n_ins_since_vacuum0R- + +pg_catalog +pg_catalogpg_stat_user_tablesbint8M + last_vacuum0R- + +pg_catalog +pg_catalogpg_stat_user_tablesb  timestamptzQ +last_autovacuum0R- + +pg_catalog +pg_catalogpg_stat_user_tablesb  timestamptzN + last_analyze0R- + +pg_catalog +pg_catalogpg_stat_user_tablesb  timestamptzR +last_autoanalyze0R- + +pg_catalog +pg_catalogpg_stat_user_tablesb  timestamptzG + vacuum_count0R- + +pg_catalog +pg_catalogpg_stat_user_tablesbint8K +autovacuum_count0R- + +pg_catalog +pg_catalogpg_stat_user_tablesbint8H + analyze_count0R- + +pg_catalog +pg_catalogpg_stat_user_tablesbint8L +autoanalyze_count0R- + +pg_catalog +pg_catalogpg_stat_user_tablesbint8ý +% + +pg_catalog +pg_catalog pg_stat_wal> + wal_records0R% + +pg_catalog +pg_catalog pg_stat_walbint8: +wal_fpi0R% + +pg_catalog +pg_catalog pg_stat_walbint8H + wal_bytes0ÿÿÿÿÿÿÿÿÿR% + +pg_catalog +pg_catalog pg_stat_walb numericC +wal_buffers_full0R% + +pg_catalog +pg_catalog pg_stat_walbint8< + wal_write0R% + +pg_catalog +pg_catalog pg_stat_walbint8; +wal_sync0R% + +pg_catalog +pg_catalog pg_stat_walbint8C +wal_write_time0R% + +pg_catalog +pg_catalog pg_stat_walbfloat8B + wal_sync_time0R% + +pg_catalog +pg_catalog pg_stat_walbfloat8E + stats_reset0R% + +pg_catalog +pg_catalog pg_stat_walb  timestamptzË +. + +pg_catalog +pg_catalogpg_stat_wal_receiver? +pid0R. + +pg_catalog +pg_catalogpg_stat_wal_receiverbint4K +status0ÿÿÿÿÿÿÿÿÿR. + +pg_catalog +pg_catalogpg_stat_wal_receiverbtextO +receive_start_lsn0R. + +pg_catalog +pg_catalogpg_stat_wal_receiverbpg_lsnM +receive_start_tli0R. + +pg_catalog +pg_catalogpg_stat_wal_receiverbint4I + written_lsn0R. + +pg_catalog +pg_catalogpg_stat_wal_receiverbpg_lsnI + flushed_lsn0R. + +pg_catalog +pg_catalogpg_stat_wal_receiverbpg_lsnH + received_tli0R. + +pg_catalog +pg_catalogpg_stat_wal_receiverbint4U +last_msg_send_time0R. + +pg_catalog +pg_catalogpg_stat_wal_receiverb  timestamptzX +last_msg_receipt_time0R. + +pg_catalog +pg_catalogpg_stat_wal_receiverb  timestamptzL +latest_end_lsn0R. + +pg_catalog +pg_catalogpg_stat_wal_receiverbpg_lsnR +latest_end_time0R. + +pg_catalog +pg_catalogpg_stat_wal_receiverb  timestamptzN + slot_name0ÿÿÿÿÿÿÿÿÿR. + +pg_catalog +pg_catalogpg_stat_wal_receiverbtextP + sender_host0ÿÿÿÿÿÿÿÿÿR. + +pg_catalog +pg_catalogpg_stat_wal_receiverbtextG + sender_port0R. + +pg_catalog +pg_catalogpg_stat_wal_receiverbint4M +conninfo0ÿÿÿÿÿÿÿÿÿR. + +pg_catalog +pg_catalogpg_stat_wal_receiverbtextä +1 + +pg_catalog +pg_catalogpg_stat_xact_all_tablesC +relid0R1 + +pg_catalog +pg_catalogpg_stat_xact_all_tablesboidI + +schemaname0@R1 + +pg_catalog +pg_catalogpg_stat_xact_all_tablesbnameF +relname0@R1 + +pg_catalog +pg_catalogpg_stat_xact_all_tablesbnameG +seq_scan0R1 + +pg_catalog +pg_catalogpg_stat_xact_all_tablesbint8K + seq_tup_read0R1 + +pg_catalog +pg_catalogpg_stat_xact_all_tablesbint8G +idx_scan0R1 + +pg_catalog +pg_catalogpg_stat_xact_all_tablesbint8L + idx_tup_fetch0R1 + +pg_catalog +pg_catalogpg_stat_xact_all_tablesbint8H + n_tup_ins0R1 + +pg_catalog +pg_catalogpg_stat_xact_all_tablesbint8H + n_tup_upd0R1 + +pg_catalog +pg_catalogpg_stat_xact_all_tablesbint8H + n_tup_del0R1 + +pg_catalog +pg_catalogpg_stat_xact_all_tablesbint8L + n_tup_hot_upd0R1 + +pg_catalog +pg_catalogpg_stat_xact_all_tablesbint8ä +1 + +pg_catalog +pg_catalogpg_stat_xact_sys_tablesC +relid0R1 + +pg_catalog +pg_catalogpg_stat_xact_sys_tablesboidI + +schemaname0@R1 + +pg_catalog +pg_catalogpg_stat_xact_sys_tablesbnameF +relname0@R1 + +pg_catalog +pg_catalogpg_stat_xact_sys_tablesbnameG +seq_scan0R1 + +pg_catalog +pg_catalogpg_stat_xact_sys_tablesbint8K + seq_tup_read0R1 + +pg_catalog +pg_catalogpg_stat_xact_sys_tablesbint8G +idx_scan0R1 + +pg_catalog +pg_catalogpg_stat_xact_sys_tablesbint8L + idx_tup_fetch0R1 + +pg_catalog +pg_catalogpg_stat_xact_sys_tablesbint8H + n_tup_ins0R1 + +pg_catalog +pg_catalogpg_stat_xact_sys_tablesbint8H + n_tup_upd0R1 + +pg_catalog +pg_catalogpg_stat_xact_sys_tablesbint8H + n_tup_del0R1 + +pg_catalog +pg_catalogpg_stat_xact_sys_tablesbint8L + n_tup_hot_upd0R1 + +pg_catalog +pg_catalogpg_stat_xact_sys_tablesbint8ˆ +5 + +pg_catalog +pg_catalogpg_stat_xact_user_functionsH +funcid0R5 + +pg_catalog +pg_catalogpg_stat_xact_user_functionsboidM + +schemaname0@R5 + +pg_catalog +pg_catalogpg_stat_xact_user_functionsbnameK +funcname0@R5 + +pg_catalog +pg_catalogpg_stat_xact_user_functionsbnameH +calls0R5 + +pg_catalog +pg_catalogpg_stat_xact_user_functionsbint8O + +total_time0R5 + +pg_catalog +pg_catalogpg_stat_xact_user_functionsbfloat8N + self_time0R5 + +pg_catalog +pg_catalogpg_stat_xact_user_functionsbfloat8ð +2 + +pg_catalog +pg_catalogpg_stat_xact_user_tablesD +relid0R2 + +pg_catalog +pg_catalogpg_stat_xact_user_tablesboidJ + +schemaname0@R2 + +pg_catalog +pg_catalogpg_stat_xact_user_tablesbnameG +relname0@R2 + +pg_catalog +pg_catalogpg_stat_xact_user_tablesbnameH +seq_scan0R2 + +pg_catalog +pg_catalogpg_stat_xact_user_tablesbint8L + seq_tup_read0R2 + +pg_catalog +pg_catalogpg_stat_xact_user_tablesbint8H +idx_scan0R2 + +pg_catalog +pg_catalogpg_stat_xact_user_tablesbint8M + idx_tup_fetch0R2 + +pg_catalog +pg_catalogpg_stat_xact_user_tablesbint8I + n_tup_ins0R2 + +pg_catalog +pg_catalogpg_stat_xact_user_tablesbint8I + n_tup_upd0R2 + +pg_catalog +pg_catalogpg_stat_xact_user_tablesbint8I + n_tup_del0R2 + +pg_catalog +pg_catalogpg_stat_xact_user_tablesbint8M + n_tup_hot_upd0R2 + +pg_catalog +pg_catalogpg_stat_xact_user_tablesbint8­ +/ + +pg_catalog +pg_catalogpg_statio_all_indexesA +relid0R/ + +pg_catalog +pg_catalogpg_statio_all_indexesboidF + +indexrelid0R/ + +pg_catalog +pg_catalogpg_statio_all_indexesboidG + +schemaname0@R/ + +pg_catalog +pg_catalogpg_statio_all_indexesbnameD +relname0@R/ + +pg_catalog +pg_catalogpg_statio_all_indexesbnameI + indexrelname0@R/ + +pg_catalog +pg_catalogpg_statio_all_indexesbnameJ + idx_blks_read0R/ + +pg_catalog +pg_catalogpg_statio_all_indexesbint8I + idx_blks_hit0R/ + +pg_catalog +pg_catalogpg_statio_all_indexesbint8ž +1 + +pg_catalog +pg_catalogpg_statio_all_sequencesC +relid0R1 + +pg_catalog +pg_catalogpg_statio_all_sequencesboidI + +schemaname0@R1 + +pg_catalog +pg_catalogpg_statio_all_sequencesbnameF +relname0@R1 + +pg_catalog +pg_catalogpg_statio_all_sequencesbnameH + blks_read0R1 + +pg_catalog +pg_catalogpg_statio_all_sequencesbint8G +blks_hit0R1 + +pg_catalog +pg_catalogpg_statio_all_sequencesbint8Û +. + +pg_catalog +pg_catalogpg_statio_all_tables@ +relid0R. + +pg_catalog +pg_catalogpg_statio_all_tablesboidF + +schemaname0@R. + +pg_catalog +pg_catalogpg_statio_all_tablesbnameC +relname0@R. + +pg_catalog +pg_catalogpg_statio_all_tablesbnameJ +heap_blks_read0R. + +pg_catalog +pg_catalogpg_statio_all_tablesbint8I + heap_blks_hit0R. + +pg_catalog +pg_catalogpg_statio_all_tablesbint8I + idx_blks_read0R. + +pg_catalog +pg_catalogpg_statio_all_tablesbint8H + idx_blks_hit0R. + +pg_catalog +pg_catalogpg_statio_all_tablesbint8K +toast_blks_read0R. + +pg_catalog +pg_catalogpg_statio_all_tablesbint8J +toast_blks_hit0R. + +pg_catalog +pg_catalogpg_statio_all_tablesbint8J +tidx_blks_read0R. + +pg_catalog +pg_catalogpg_statio_all_tablesbint8I + tidx_blks_hit0R. + +pg_catalog +pg_catalogpg_statio_all_tablesbint8­ +/ + +pg_catalog +pg_catalogpg_statio_sys_indexesA +relid0R/ + +pg_catalog +pg_catalogpg_statio_sys_indexesboidF + +indexrelid0R/ + +pg_catalog +pg_catalogpg_statio_sys_indexesboidG + +schemaname0@R/ + +pg_catalog +pg_catalogpg_statio_sys_indexesbnameD +relname0@R/ + +pg_catalog +pg_catalogpg_statio_sys_indexesbnameI + indexrelname0@R/ + +pg_catalog +pg_catalogpg_statio_sys_indexesbnameJ + idx_blks_read0R/ + +pg_catalog +pg_catalogpg_statio_sys_indexesbint8I + idx_blks_hit0R/ + +pg_catalog +pg_catalogpg_statio_sys_indexesbint8ž +1 + +pg_catalog +pg_catalogpg_statio_sys_sequencesC +relid0R1 + +pg_catalog +pg_catalogpg_statio_sys_sequencesboidI + +schemaname0@R1 + +pg_catalog +pg_catalogpg_statio_sys_sequencesbnameF +relname0@R1 + +pg_catalog +pg_catalogpg_statio_sys_sequencesbnameH + blks_read0R1 + +pg_catalog +pg_catalogpg_statio_sys_sequencesbint8G +blks_hit0R1 + +pg_catalog +pg_catalogpg_statio_sys_sequencesbint8Û +. + +pg_catalog +pg_catalogpg_statio_sys_tables@ +relid0R. + +pg_catalog +pg_catalogpg_statio_sys_tablesboidF + +schemaname0@R. + +pg_catalog +pg_catalogpg_statio_sys_tablesbnameC +relname0@R. + +pg_catalog +pg_catalogpg_statio_sys_tablesbnameJ +heap_blks_read0R. + +pg_catalog +pg_catalogpg_statio_sys_tablesbint8I + heap_blks_hit0R. + +pg_catalog +pg_catalogpg_statio_sys_tablesbint8I + idx_blks_read0R. + +pg_catalog +pg_catalogpg_statio_sys_tablesbint8H + idx_blks_hit0R. + +pg_catalog +pg_catalogpg_statio_sys_tablesbint8K +toast_blks_read0R. + +pg_catalog +pg_catalogpg_statio_sys_tablesbint8J +toast_blks_hit0R. + +pg_catalog +pg_catalogpg_statio_sys_tablesbint8J +tidx_blks_read0R. + +pg_catalog +pg_catalogpg_statio_sys_tablesbint8I + tidx_blks_hit0R. + +pg_catalog +pg_catalogpg_statio_sys_tablesbint8µ +0 + +pg_catalog +pg_catalogpg_statio_user_indexesB +relid0R0 + +pg_catalog +pg_catalogpg_statio_user_indexesboidG + +indexrelid0R0 + +pg_catalog +pg_catalogpg_statio_user_indexesboidH + +schemaname0@R0 + +pg_catalog +pg_catalogpg_statio_user_indexesbnameE +relname0@R0 + +pg_catalog +pg_catalogpg_statio_user_indexesbnameJ + indexrelname0@R0 + +pg_catalog +pg_catalogpg_statio_user_indexesbnameK + idx_blks_read0R0 + +pg_catalog +pg_catalogpg_statio_user_indexesbint8J + idx_blks_hit0R0 + +pg_catalog +pg_catalogpg_statio_user_indexesbint8¤ +2 + +pg_catalog +pg_catalogpg_statio_user_sequencesD +relid0R2 + +pg_catalog +pg_catalogpg_statio_user_sequencesboidJ + +schemaname0@R2 + +pg_catalog +pg_catalogpg_statio_user_sequencesbnameG +relname0@R2 + +pg_catalog +pg_catalogpg_statio_user_sequencesbnameI + blks_read0R2 + +pg_catalog +pg_catalogpg_statio_user_sequencesbint8H +blks_hit0R2 + +pg_catalog +pg_catalogpg_statio_user_sequencesbint8ç +/ + +pg_catalog +pg_catalogpg_statio_user_tablesA +relid0R/ + +pg_catalog +pg_catalogpg_statio_user_tablesboidG + +schemaname0@R/ + +pg_catalog +pg_catalogpg_statio_user_tablesbnameD +relname0@R/ + +pg_catalog +pg_catalogpg_statio_user_tablesbnameK +heap_blks_read0R/ + +pg_catalog +pg_catalogpg_statio_user_tablesbint8J + heap_blks_hit0R/ + +pg_catalog +pg_catalogpg_statio_user_tablesbint8J + idx_blks_read0R/ + +pg_catalog +pg_catalogpg_statio_user_tablesbint8I + idx_blks_hit0R/ + +pg_catalog +pg_catalogpg_statio_user_tablesbint8L +toast_blks_read0R/ + +pg_catalog +pg_catalogpg_statio_user_tablesbint8K +toast_blks_hit0R/ + +pg_catalog +pg_catalogpg_statio_user_tablesbint8K +tidx_blks_read0R/ + +pg_catalog +pg_catalogpg_statio_user_tablesbint8J + tidx_blks_hit0R/ + +pg_catalog +pg_catalogpg_statio_user_tablesbint8Ò +& + +pg_catalog +pg_catalog pg_statistic= +tableoid0R& + +pg_catalog +pg_catalog pg_statisticboid9 +cmax0R& + +pg_catalog +pg_catalog pg_statisticbcid9 +xmax0R& + +pg_catalog +pg_catalog pg_statisticbxid9 +cmin0R& + +pg_catalog +pg_catalog pg_statisticbcid9 +xmin0R& + +pg_catalog +pg_catalog pg_statisticbxid9 +ctid0R& + +pg_catalog +pg_catalog pg_statisticbtid= +starelid0R& + +pg_catalog +pg_catalog pg_statisticboid? + staattnum0R& + +pg_catalog +pg_catalog pg_statisticbint2@ + +stainherit0R& + +pg_catalog +pg_catalog pg_statisticbboolC + stanullfrac0R& + +pg_catalog +pg_catalog pg_statisticbfloat4> +stawidth0R& + +pg_catalog +pg_catalog pg_statisticbint4C + stadistinct0R& + +pg_catalog +pg_catalog pg_statisticbfloat4> +stakind10R& + +pg_catalog +pg_catalog pg_statisticbint2> +stakind20R& + +pg_catalog +pg_catalog pg_statisticbint2> +stakind30R& + +pg_catalog +pg_catalog pg_statisticbint2> +stakind40R& + +pg_catalog +pg_catalog pg_statisticbint2> +stakind50R& + +pg_catalog +pg_catalog pg_statisticbint2; +staop10R& + +pg_catalog +pg_catalog pg_statisticboid; +staop20R& + +pg_catalog +pg_catalog pg_statisticboid; +staop30R& + +pg_catalog +pg_catalog pg_statisticboid; +staop40R& + +pg_catalog +pg_catalog pg_statisticboid; +staop50R& + +pg_catalog +pg_catalog pg_statisticboid= +stacoll10R& + +pg_catalog +pg_catalog pg_statisticboid= +stacoll20R& + +pg_catalog +pg_catalog pg_statisticboid= +stacoll30R& + +pg_catalog +pg_catalog pg_statisticboid= +stacoll40R& + +pg_catalog +pg_catalog pg_statisticboid= +stacoll50R& + +pg_catalog +pg_catalog pg_statisticboidM + stanumbers1 0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_statisticb _float4M + stanumbers2 0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_statisticb _float4M + stanumbers3 0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_statisticb _float4M + stanumbers4 0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_statisticb _float4M + stanumbers5 0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_statisticb _float4K + +stavalues10ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_statisticb +anyarrayK + +stavalues20ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_statisticb +anyarrayK + +stavalues30ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_statisticb +anyarrayK + +stavalues40ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_statisticb +anyarrayK + +stavalues50ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_statisticb +anyarray· +* + +pg_catalog +pg_catalogpg_statistic_extA +tableoid0R* + +pg_catalog +pg_catalogpg_statistic_extboid= +cmax0R* + +pg_catalog +pg_catalogpg_statistic_extbcid= +xmax0R* + +pg_catalog +pg_catalogpg_statistic_extbxid= +cmin0R* + +pg_catalog +pg_catalogpg_statistic_extbcid= +xmin0R* + +pg_catalog +pg_catalogpg_statistic_extbxid= +ctid0R* + +pg_catalog +pg_catalogpg_statistic_extbtid< +oid0R* + +pg_catalog +pg_catalogpg_statistic_extboidA +stxrelid0R* + +pg_catalog +pg_catalogpg_statistic_extboidA +stxname0@R* + +pg_catalog +pg_catalogpg_statistic_extbnameE + stxnamespace0R* + +pg_catalog +pg_catalogpg_statistic_extboidA +stxowner0R* + +pg_catalog +pg_catalogpg_statistic_extboidG + stxstattarget0R* + +pg_catalog +pg_catalogpg_statistic_extbint4R +stxkeys 0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_statistic_extb  +int2vectorM +stxkind 0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_statistic_extb_charQ +stxexprs0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_statistic_extb pg_node_treeÐ +/ + +pg_catalog +pg_catalogpg_statistic_ext_dataF +tableoid0R/ + +pg_catalog +pg_catalogpg_statistic_ext_databoidB +cmax0R/ + +pg_catalog +pg_catalogpg_statistic_ext_databcidB +xmax0R/ + +pg_catalog +pg_catalogpg_statistic_ext_databxidB +cmin0R/ + +pg_catalog +pg_catalogpg_statistic_ext_databcidB +xmin0R/ + +pg_catalog +pg_catalogpg_statistic_ext_databxidB +ctid0R/ + +pg_catalog +pg_catalogpg_statistic_ext_databtidD +stxoid0R/ + +pg_catalog +pg_catalogpg_statistic_ext_databoidJ + stxdinherit0R/ + +pg_catalog +pg_catalogpg_statistic_ext_databbool[ + stxdndistinct0ÿÿÿÿÿÿÿÿÿR/ + +pg_catalog +pg_catalogpg_statistic_ext_datab pg_ndistincta +stxddependencies0ÿÿÿÿÿÿÿÿÿR/ + +pg_catalog +pg_catalogpg_statistic_ext_databpg_dependenciesT +stxdmcv0ÿÿÿÿÿÿÿÿÿR/ + +pg_catalog +pg_catalogpg_statistic_ext_datab  pg_mcv_listY +stxdexpr 0ÿÿÿÿÿÿÿÿÿR/ + +pg_catalog +pg_catalogpg_statistic_ext_datab _pg_statisticí +" + +pg_catalog +pg_catalogpg_stats: + +schemaname0@R" + +pg_catalog +pg_catalogpg_statsbname9 + tablename0@R" + +pg_catalog +pg_catalogpg_statsbname7 +attname0@R" + +pg_catalog +pg_catalogpg_statsbname9 + inherited0R" + +pg_catalog +pg_catalogpg_statsbbool; + null_frac0R" + +pg_catalog +pg_catalogpg_statsbfloat49 + avg_width0R" + +pg_catalog +pg_catalogpg_statsbint4< + +n_distinct0R" + +pg_catalog +pg_catalogpg_statsbfloat4M +most_common_vals0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_statsb +anyarrayO +most_common_freqs 0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_statsb _float4M +histogram_bounds0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_statsb +anyarray= + correlation0R" + +pg_catalog +pg_catalogpg_statsbfloat4N +most_common_elems0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_statsb +anyarrayT +most_common_elem_freqs 0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_statsb _float4R +elem_count_histogram 0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_statsb _float4“ +& + +pg_catalog +pg_catalog pg_stats_ext> + +schemaname0@R& + +pg_catalog +pg_catalog pg_stats_extbname= + tablename0@R& + +pg_catalog +pg_catalog pg_stats_extbnameI +statistics_schemaname0@R& + +pg_catalog +pg_catalog pg_stats_extbnameC +statistics_name0@R& + +pg_catalog +pg_catalog pg_stats_extbnameD +statistics_owner0@R& + +pg_catalog +pg_catalog pg_stats_extbnameH +attnames 0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_stats_extb_nameE +exprs 0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_stats_extb_textE +kinds 0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_stats_extb_char= + inherited0R& + +pg_catalog +pg_catalog pg_stats_extbboolO + +n_distinct0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_stats_extb pg_ndistinctT + dependencies0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_stats_extbpg_dependenciesP +most_common_vals 0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_stats_extb_textU +most_common_val_nulls 0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_stats_extb_boolS +most_common_freqs 0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_stats_extb _float8X +most_common_base_freqs 0ÿÿÿÿÿÿÿÿÿR& + +pg_catalog +pg_catalog pg_stats_extb _float8ñ + +, + +pg_catalog +pg_catalogpg_stats_ext_exprsD + +schemaname0@R, + +pg_catalog +pg_catalogpg_stats_ext_exprsbnameC + tablename0@R, + +pg_catalog +pg_catalogpg_stats_ext_exprsbnameO +statistics_schemaname0@R, + +pg_catalog +pg_catalogpg_stats_ext_exprsbnameI +statistics_name0@R, + +pg_catalog +pg_catalogpg_stats_ext_exprsbnameJ +statistics_owner0@R, + +pg_catalog +pg_catalogpg_stats_ext_exprsbnameG +expr0ÿÿÿÿÿÿÿÿÿR, + +pg_catalog +pg_catalogpg_stats_ext_exprsbtextC + inherited0R, + +pg_catalog +pg_catalogpg_stats_ext_exprsbboolE + null_frac0R, + +pg_catalog +pg_catalogpg_stats_ext_exprsbfloat4C + avg_width0R, + +pg_catalog +pg_catalogpg_stats_ext_exprsbint4F + +n_distinct0R, + +pg_catalog +pg_catalogpg_stats_ext_exprsbfloat4W +most_common_vals0ÿÿÿÿÿÿÿÿÿR, + +pg_catalog +pg_catalogpg_stats_ext_exprsb +anyarrayY +most_common_freqs 0ÿÿÿÿÿÿÿÿÿR, + +pg_catalog +pg_catalogpg_stats_ext_exprsb _float4W +histogram_bounds0ÿÿÿÿÿÿÿÿÿR, + +pg_catalog +pg_catalogpg_stats_ext_exprsb +anyarrayG + correlation0R, + +pg_catalog +pg_catalogpg_stats_ext_exprsbfloat4X +most_common_elems0ÿÿÿÿÿÿÿÿÿR, + +pg_catalog +pg_catalogpg_stats_ext_exprsb +anyarray^ +most_common_elem_freqs 0ÿÿÿÿÿÿÿÿÿR, + +pg_catalog +pg_catalogpg_stats_ext_exprsb _float4\ +elem_count_histogram 0ÿÿÿÿÿÿÿÿÿR, + +pg_catalog +pg_catalogpg_stats_ext_exprsb _float4ˆ +) + +pg_catalog +pg_catalogpg_subscription@ +tableoid0R) + +pg_catalog +pg_catalogpg_subscriptionboid< +cmax0R) + +pg_catalog +pg_catalogpg_subscriptionbcid< +xmax0R) + +pg_catalog +pg_catalogpg_subscriptionbxid< +cmin0R) + +pg_catalog +pg_catalogpg_subscriptionbcid< +xmin0R) + +pg_catalog +pg_catalogpg_subscriptionbxid< +ctid0R) + +pg_catalog +pg_catalogpg_subscriptionbtid; +oid0R) + +pg_catalog +pg_catalogpg_subscriptionboid? +subdbid0R) + +pg_catalog +pg_catalogpg_subscriptionboidE + +subskiplsn0R) + +pg_catalog +pg_catalogpg_subscriptionbpg_lsn@ +subname0@R) + +pg_catalog +pg_catalogpg_subscriptionbname@ +subowner0R) + +pg_catalog +pg_catalogpg_subscriptionboidC + +subenabled0R) + +pg_catalog +pg_catalogpg_subscriptionbboolB + subbinary0R) + +pg_catalog +pg_catalogpg_subscriptionbboolB + substream0R) + +pg_catalog +pg_catalogpg_subscriptionbboolI +subtwophasestate0R) + +pg_catalog +pg_catalogpg_subscriptionbcharH +subdisableonerr0R) + +pg_catalog +pg_catalogpg_subscriptionbboolM + subconninfo0ÿÿÿÿÿÿÿÿÿR) + +pg_catalog +pg_catalogpg_subscriptionbtextB + subslotname0@R) + +pg_catalog +pg_catalogpg_subscriptionbnameO + subsynccommit0ÿÿÿÿÿÿÿÿÿR) + +pg_catalog +pg_catalogpg_subscriptionbtextT +subpublications 0ÿÿÿÿÿÿÿÿÿR) + +pg_catalog +pg_catalogpg_subscriptionb_textÙ +- + +pg_catalog +pg_catalogpg_subscription_relD +tableoid0R- + +pg_catalog +pg_catalogpg_subscription_relboid@ +cmax0R- + +pg_catalog +pg_catalogpg_subscription_relbcid@ +xmax0R- + +pg_catalog +pg_catalogpg_subscription_relbxid@ +cmin0R- + +pg_catalog +pg_catalogpg_subscription_relbcid@ +xmin0R- + +pg_catalog +pg_catalogpg_subscription_relbxid@ +ctid0R- + +pg_catalog +pg_catalogpg_subscription_relbtidC +srsubid0R- + +pg_catalog +pg_catalogpg_subscription_relboidC +srrelid0R- + +pg_catalog +pg_catalogpg_subscription_relboidG + +srsubstate0R- + +pg_catalog +pg_catalogpg_subscription_relbcharE +srsublsn0R- + +pg_catalog +pg_catalogpg_subscription_relbpg_lsnŒ +# + +pg_catalog +pg_catalog pg_tables; + +schemaname0@R# + +pg_catalog +pg_catalog pg_tablesbname: + tablename0@R# + +pg_catalog +pg_catalog pg_tablesbname; + +tableowner0@R# + +pg_catalog +pg_catalog pg_tablesbname; + +tablespace0@R# + +pg_catalog +pg_catalog pg_tablesbname; + +hasindexes0R# + +pg_catalog +pg_catalog pg_tablesbbool9 +hasrules0R# + +pg_catalog +pg_catalog pg_tablesbbool< + hastriggers0R# + +pg_catalog +pg_catalog pg_tablesbbool< + rowsecurity0R# + +pg_catalog +pg_catalog pg_tablesbboolé +' + +pg_catalog +pg_catalog pg_tablespace> +tableoid0R' + +pg_catalog +pg_catalog pg_tablespaceboid: +cmax0R' + +pg_catalog +pg_catalog pg_tablespacebcid: +xmax0R' + +pg_catalog +pg_catalog pg_tablespacebxid: +cmin0R' + +pg_catalog +pg_catalog pg_tablespacebcid: +xmin0R' + +pg_catalog +pg_catalog pg_tablespacebxid: +ctid0R' + +pg_catalog +pg_catalog pg_tablespacebtid9 +oid0R' + +pg_catalog +pg_catalog pg_tablespaceboid> +spcname0@R' + +pg_catalog +pg_catalog pg_tablespacebname> +spcowner0R' + +pg_catalog +pg_catalog pg_tablespaceboidJ +spcacl 0ÿÿÿÿÿÿÿÿÿR' + +pg_catalog +pg_catalog pg_tablespaceb +_aclitemK + +spcoptions 0ÿÿÿÿÿÿÿÿÿR' + +pg_catalog +pg_catalog pg_tablespaceb_text‰ +- + +pg_catalog +pg_catalogpg_timezone_abbrevsJ +abbrev0ÿÿÿÿÿÿÿÿÿR- + +pg_catalog +pg_catalogpg_timezone_abbrevsbtextI + +utc_offset0R- + +pg_catalog +pg_catalogpg_timezone_abbrevsb +intervalA +is_dst0R- + +pg_catalog +pg_catalogpg_timezone_abbrevsbboolÉ ++ + +pg_catalog +pg_catalogpg_timezone_namesF +name0ÿÿÿÿÿÿÿÿÿR+ + +pg_catalog +pg_catalogpg_timezone_namesbtextH +abbrev0ÿÿÿÿÿÿÿÿÿR+ + +pg_catalog +pg_catalogpg_timezone_namesbtextG + +utc_offset0R+ + +pg_catalog +pg_catalogpg_timezone_namesb +interval? +is_dst0R+ + +pg_catalog +pg_catalogpg_timezone_namesbboolÌ +& + +pg_catalog +pg_catalog pg_transform= +tableoid0R& + +pg_catalog +pg_catalog pg_transformboid9 +cmax0R& + +pg_catalog +pg_catalog pg_transformbcid9 +xmax0R& + +pg_catalog +pg_catalog pg_transformbxid9 +cmin0R& + +pg_catalog +pg_catalog pg_transformbcid9 +xmin0R& + +pg_catalog +pg_catalog pg_transformbxid9 +ctid0R& + +pg_catalog +pg_catalog pg_transformbtid8 +oid0R& + +pg_catalog +pg_catalog pg_transformboid< +trftype0R& + +pg_catalog +pg_catalog pg_transformboid< +trflang0R& + +pg_catalog +pg_catalog pg_transformboidC + +trffromsql0R& + +pg_catalog +pg_catalog pg_transformb regprocA +trftosql0R& + +pg_catalog +pg_catalog pg_transformb regprocÉ +$ + +pg_catalog +pg_catalog +pg_trigger; +tableoid0R$ + +pg_catalog +pg_catalog +pg_triggerboid7 +cmax0R$ + +pg_catalog +pg_catalog +pg_triggerbcid7 +xmax0R$ + +pg_catalog +pg_catalog +pg_triggerbxid7 +cmin0R$ + +pg_catalog +pg_catalog +pg_triggerbcid7 +xmin0R$ + +pg_catalog +pg_catalog +pg_triggerbxid7 +ctid0R$ + +pg_catalog +pg_catalog +pg_triggerbtid6 +oid0R$ + +pg_catalog +pg_catalog +pg_triggerboid: +tgrelid0R$ + +pg_catalog +pg_catalog +pg_triggerboid= + +tgparentid0R$ + +pg_catalog +pg_catalog +pg_triggerboid: +tgname0@R$ + +pg_catalog +pg_catalog +pg_triggerbname9 +tgfoid0R$ + +pg_catalog +pg_catalog +pg_triggerboid: +tgtype0R$ + +pg_catalog +pg_catalog +pg_triggerbint2= + tgenabled0R$ + +pg_catalog +pg_catalog +pg_triggerbchar@ + tgisinternal0R$ + +pg_catalog +pg_catalog +pg_triggerbbool@ + tgconstrrelid0R$ + +pg_catalog +pg_catalog +pg_triggerboid@ + tgconstrindid0R$ + +pg_catalog +pg_catalog +pg_triggerboid? + tgconstraint0R$ + +pg_catalog +pg_catalog +pg_triggerboid@ + tgdeferrable0R$ + +pg_catalog +pg_catalog +pg_triggerbboolB +tginitdeferred0R$ + +pg_catalog +pg_catalog +pg_triggerbbool; +tgnargs0R$ + +pg_catalog +pg_catalog +pg_triggerbint2K +tgattr 0ÿÿÿÿÿÿÿÿÿR$ + +pg_catalog +pg_catalog +pg_triggerb  +int2vectorD +tgargs0ÿÿÿÿÿÿÿÿÿR$ + +pg_catalog +pg_catalog +pg_triggerbbyteaI +tgqual0ÿÿÿÿÿÿÿÿÿR$ + +pg_catalog +pg_catalog +pg_triggerb pg_node_tree< + +tgoldtable0@R$ + +pg_catalog +pg_catalog +pg_triggerbname< + +tgnewtable0@R$ + +pg_catalog +pg_catalog +pg_triggerbnameÉ +& + +pg_catalog +pg_catalog pg_ts_config= +tableoid0R& + +pg_catalog +pg_catalog pg_ts_configboid9 +cmax0R& + +pg_catalog +pg_catalog pg_ts_configbcid9 +xmax0R& + +pg_catalog +pg_catalog pg_ts_configbxid9 +cmin0R& + +pg_catalog +pg_catalog pg_ts_configbcid9 +xmin0R& + +pg_catalog +pg_catalog pg_ts_configbxid9 +ctid0R& + +pg_catalog +pg_catalog pg_ts_configbtid8 +oid0R& + +pg_catalog +pg_catalog pg_ts_configboid= +cfgname0@R& + +pg_catalog +pg_catalog pg_ts_configbnameA + cfgnamespace0R& + +pg_catalog +pg_catalog pg_ts_configboid= +cfgowner0R& + +pg_catalog +pg_catalog pg_ts_configboid> + cfgparser0R& + +pg_catalog +pg_catalog pg_ts_configboid¹ +* + +pg_catalog +pg_catalogpg_ts_config_mapA +tableoid0R* + +pg_catalog +pg_catalogpg_ts_config_mapboid= +cmax0R* + +pg_catalog +pg_catalogpg_ts_config_mapbcid= +xmax0R* + +pg_catalog +pg_catalogpg_ts_config_mapbxid= +cmin0R* + +pg_catalog +pg_catalogpg_ts_config_mapbcid= +xmin0R* + +pg_catalog +pg_catalogpg_ts_config_mapbxid= +ctid0R* + +pg_catalog +pg_catalogpg_ts_config_mapbtid? +mapcfg0R* + +pg_catalog +pg_catalogpg_ts_config_mapboidF + maptokentype0R* + +pg_catalog +pg_catalogpg_ts_config_mapbint4B +mapseqno0R* + +pg_catalog +pg_catalogpg_ts_config_mapbint4@ +mapdict0R* + +pg_catalog +pg_catalogpg_ts_config_mapboid‚ +$ + +pg_catalog +pg_catalog +pg_ts_dict; +tableoid0R$ + +pg_catalog +pg_catalog +pg_ts_dictboid7 +cmax0R$ + +pg_catalog +pg_catalog +pg_ts_dictbcid7 +xmax0R$ + +pg_catalog +pg_catalog +pg_ts_dictbxid7 +cmin0R$ + +pg_catalog +pg_catalog +pg_ts_dictbcid7 +xmin0R$ + +pg_catalog +pg_catalog +pg_ts_dictbxid7 +ctid0R$ + +pg_catalog +pg_catalog +pg_ts_dictbtid6 +oid0R$ + +pg_catalog +pg_catalog +pg_ts_dictboid< +dictname0@R$ + +pg_catalog +pg_catalog +pg_ts_dictbname@ + dictnamespace0R$ + +pg_catalog +pg_catalog +pg_ts_dictboid< + dictowner0R$ + +pg_catalog +pg_catalog +pg_ts_dictboid? + dicttemplate0R$ + +pg_catalog +pg_catalog +pg_ts_dictboidI +dictinitoption0ÿÿÿÿÿÿÿÿÿR$ + +pg_catalog +pg_catalog +pg_ts_dictbtextœ +& + +pg_catalog +pg_catalog pg_ts_parser= +tableoid0R& + +pg_catalog +pg_catalog pg_ts_parserboid9 +cmax0R& + +pg_catalog +pg_catalog pg_ts_parserbcid9 +xmax0R& + +pg_catalog +pg_catalog pg_ts_parserbxid9 +cmin0R& + +pg_catalog +pg_catalog pg_ts_parserbcid9 +xmin0R& + +pg_catalog +pg_catalog pg_ts_parserbxid9 +ctid0R& + +pg_catalog +pg_catalog pg_ts_parserbtid8 +oid0R& + +pg_catalog +pg_catalog pg_ts_parserboid= +prsname0@R& + +pg_catalog +pg_catalog pg_ts_parserbnameA + prsnamespace0R& + +pg_catalog +pg_catalog pg_ts_parserboidA +prsstart0R& + +pg_catalog +pg_catalog pg_ts_parserb regprocA +prstoken0R& + +pg_catalog +pg_catalog pg_ts_parserb regproc? +prsend0R& + +pg_catalog +pg_catalog pg_ts_parserb regprocD + prsheadline0R& + +pg_catalog +pg_catalog pg_ts_parserb regprocC + +prslextype0R& + +pg_catalog +pg_catalog pg_ts_parserb regprocì +( + +pg_catalog +pg_catalogpg_ts_template? +tableoid0R( + +pg_catalog +pg_catalogpg_ts_templateboid; +cmax0R( + +pg_catalog +pg_catalogpg_ts_templatebcid; +xmax0R( + +pg_catalog +pg_catalogpg_ts_templatebxid; +cmin0R( + +pg_catalog +pg_catalogpg_ts_templatebcid; +xmin0R( + +pg_catalog +pg_catalogpg_ts_templatebxid; +ctid0R( + +pg_catalog +pg_catalogpg_ts_templatebtid: +oid0R( + +pg_catalog +pg_catalogpg_ts_templateboid@ +tmplname0@R( + +pg_catalog +pg_catalogpg_ts_templatebnameD + tmplnamespace0R( + +pg_catalog +pg_catalogpg_ts_templateboidC +tmplinit0R( + +pg_catalog +pg_catalogpg_ts_templateb regprocE + +tmpllexize0R( + +pg_catalog +pg_catalogpg_ts_templateb regprocŸ +! + +pg_catalog +pg_catalogpg_type8 +tableoid0R! + +pg_catalog +pg_catalogpg_typeboid4 +cmax0R! + +pg_catalog +pg_catalogpg_typebcid4 +xmax0R! + +pg_catalog +pg_catalogpg_typebxid4 +cmin0R! + +pg_catalog +pg_catalogpg_typebcid4 +xmin0R! + +pg_catalog +pg_catalogpg_typebxid4 +ctid0R! + +pg_catalog +pg_catalogpg_typebtid3 +oid0R! + +pg_catalog +pg_catalogpg_typeboid8 +typname0@R! + +pg_catalog +pg_catalogpg_typebname< + typnamespace0R! + +pg_catalog +pg_catalogpg_typeboid8 +typowner0R! + +pg_catalog +pg_catalogpg_typeboid7 +typlen0R! + +pg_catalog +pg_catalogpg_typebint29 +typbyval0R! + +pg_catalog +pg_catalogpg_typebbool8 +typtype0R! + +pg_catalog +pg_catalogpg_typebchar< + typcategory0R! + +pg_catalog +pg_catalogpg_typebchar? +typispreferred0R! + +pg_catalog +pg_catalogpg_typebbool= + typisdefined0R! + +pg_catalog +pg_catalogpg_typebbool9 +typdelim0R! + +pg_catalog +pg_catalogpg_typebchar8 +typrelid0R! + +pg_catalog +pg_catalogpg_typeboid@ + typsubscript0R! + +pg_catalog +pg_catalogpg_typeb regproc7 +typelem0R! + +pg_catalog +pg_catalogpg_typeboid8 +typarray0R! + +pg_catalog +pg_catalogpg_typeboid< +typinput0R! + +pg_catalog +pg_catalogpg_typeb regproc= + typoutput0R! + +pg_catalog +pg_catalogpg_typeb regproc> + +typreceive0R! + +pg_catalog +pg_catalogpg_typeb regproc; +typsend0R! + +pg_catalog +pg_catalogpg_typeb regproc< +typmodin0R! + +pg_catalog +pg_catalogpg_typeb regproc= + typmodout0R! + +pg_catalog +pg_catalogpg_typeb regproc> + +typanalyze0R! + +pg_catalog +pg_catalogpg_typeb regproc9 +typalign0R! + +pg_catalog +pg_catalogpg_typebchar; + +typstorage0R! + +pg_catalog +pg_catalogpg_typebchar; + +typnotnull0R! + +pg_catalog +pg_catalogpg_typebbool; + typbasetype0R! + +pg_catalog +pg_catalogpg_typeboid: + typtypmod0R! + +pg_catalog +pg_catalogpg_typebint49 +typndims0R! + +pg_catalog +pg_catalogpg_typebint4< + typcollation0R! + +pg_catalog +pg_catalogpg_typeboidM + typdefaultbin0ÿÿÿÿÿÿÿÿÿR! + +pg_catalog +pg_catalogpg_typeb pg_node_treeB + +typdefault0ÿÿÿÿÿÿÿÿÿR! + +pg_catalog +pg_catalogpg_typebtextD +typacl 0ÿÿÿÿÿÿÿÿÿR! + +pg_catalog +pg_catalogpg_typeb +_aclitemà +! + +pg_catalog +pg_catalogpg_user6 +usename0@R! + +pg_catalog +pg_catalogpg_userbname6 +usesysid0R! + +pg_catalog +pg_catalogpg_userboid: + usecreatedb0R! + +pg_catalog +pg_catalogpg_userbbool7 +usesuper0R! + +pg_catalog +pg_catalogpg_userbbool6 +userepl0R! + +pg_catalog +pg_catalogpg_userbbool; + usebypassrls0R! + +pg_catalog +pg_catalogpg_userbbool> +passwd0ÿÿÿÿÿÿÿÿÿR! + +pg_catalog +pg_catalogpg_userbtext> +valuntil0R! + +pg_catalog +pg_catalogpg_userb  timestamptzD + useconfig 0ÿÿÿÿÿÿÿÿÿR! + +pg_catalog +pg_catalogpg_userb_text° +) + +pg_catalog +pg_catalogpg_user_mapping@ +tableoid0R) + +pg_catalog +pg_catalogpg_user_mappingboid< +cmax0R) + +pg_catalog +pg_catalogpg_user_mappingbcid< +xmax0R) + +pg_catalog +pg_catalogpg_user_mappingbxid< +cmin0R) + +pg_catalog +pg_catalogpg_user_mappingbcid< +xmin0R) + +pg_catalog +pg_catalogpg_user_mappingbxid< +ctid0R) + +pg_catalog +pg_catalogpg_user_mappingbtid; +oid0R) + +pg_catalog +pg_catalogpg_user_mappingboid> +umuser0R) + +pg_catalog +pg_catalogpg_user_mappingboid@ +umserver0R) + +pg_catalog +pg_catalogpg_user_mappingboidL + umoptions 0ÿÿÿÿÿÿÿÿÿR) + +pg_catalog +pg_catalogpg_user_mappingb_text· +* + +pg_catalog +pg_catalogpg_user_mappings; +umid0R* + +pg_catalog +pg_catalogpg_user_mappingsboid< +srvid0R* + +pg_catalog +pg_catalogpg_user_mappingsboid? +srvname0@R* + +pg_catalog +pg_catalogpg_user_mappingsbname= +umuser0R* + +pg_catalog +pg_catalogpg_user_mappingsboid? +usename0@R* + +pg_catalog +pg_catalogpg_user_mappingsbnameM + umoptions 0ÿÿÿÿÿÿÿÿÿR* + +pg_catalog +pg_catalogpg_user_mappingsb_textš +" + +pg_catalog +pg_catalogpg_views: + +schemaname0@R" + +pg_catalog +pg_catalogpg_viewsbname8 +viewname0@R" + +pg_catalog +pg_catalogpg_viewsbname9 + viewowner0@R" + +pg_catalog +pg_catalogpg_viewsbnameC + +definition0ÿÿÿÿÿÿÿÿÿR" + +pg_catalog +pg_catalogpg_viewsbtext"¨›information_schema„ +; + +pg_cataloginformation_schema_pg_foreign_data_wrappersK +oid0R; + +pg_cataloginformation_schema_pg_foreign_data_wrappersboidP +fdwowner0R; + +pg_cataloginformation_schema_pg_foreign_data_wrappersboid_ + +fdwoptions 0ÿÿÿÿÿÿÿÿÿR; + +pg_cataloginformation_schema_pg_foreign_data_wrappersb_texto +foreign_data_wrapper_catalog0@R; + +pg_cataloginformation_schema_pg_foreign_data_wrappersbsql_identifierl +foreign_data_wrapper_name0@R; + +pg_cataloginformation_schema_pg_foreign_data_wrappersbsql_identifierk +authorization_identifier0@R; + +pg_cataloginformation_schema_pg_foreign_data_wrappersbsql_identifiery +foreign_data_wrapper_language0ÿÿÿÿÿÿÿÿÿR; + +pg_cataloginformation_schema_pg_foreign_data_wrappersbcharacter_data³ +5 + +pg_cataloginformation_schema_pg_foreign_serversE +oid0R5 + +pg_cataloginformation_schema_pg_foreign_serversboidY + +srvoptions 0ÿÿÿÿÿÿÿÿÿR5 + +pg_cataloginformation_schema_pg_foreign_serversb_textc +foreign_server_catalog0@R5 + +pg_cataloginformation_schema_pg_foreign_serversbsql_identifier` +foreign_server_name0@R5 + +pg_cataloginformation_schema_pg_foreign_serversbsql_identifieri +foreign_data_wrapper_catalog0@R5 + +pg_cataloginformation_schema_pg_foreign_serversbsql_identifierf +foreign_data_wrapper_name0@R5 + +pg_cataloginformation_schema_pg_foreign_serversbsql_identifieri +foreign_server_type0ÿÿÿÿÿÿÿÿÿR5 + +pg_cataloginformation_schema_pg_foreign_serversbcharacter_datal +foreign_server_version0ÿÿÿÿÿÿÿÿÿR5 + +pg_cataloginformation_schema_pg_foreign_serversbcharacter_datae +authorization_identifier0@R5 + +pg_cataloginformation_schema_pg_foreign_serversbsql_identifier— +; + +pg_cataloginformation_schema_pg_foreign_table_columnsP +nspname0@R; + +pg_cataloginformation_schema_pg_foreign_table_columnsbnameP +relname0@R; + +pg_cataloginformation_schema_pg_foreign_table_columnsbnameP +attname0@R; + +pg_cataloginformation_schema_pg_foreign_table_columnsbnameb + attfdwoptions 0ÿÿÿÿÿÿÿÿÿR; + +pg_cataloginformation_schema_pg_foreign_table_columnsb_textß +4 + +pg_cataloginformation_schema_pg_foreign_tablesa +foreign_table_catalog0@R4 + +pg_cataloginformation_schema_pg_foreign_tablesbsql_identifier` +foreign_table_schema0@R4 + +pg_cataloginformation_schema_pg_foreign_tablesbsql_identifier^ +foreign_table_name0@R4 + +pg_cataloginformation_schema_pg_foreign_tablesbsql_identifierW + ftoptions 0ÿÿÿÿÿÿÿÿÿR4 + +pg_cataloginformation_schema_pg_foreign_tablesb_textb +foreign_server_catalog0@R4 + +pg_cataloginformation_schema_pg_foreign_tablesbsql_identifier_ +foreign_server_name0@R4 + +pg_cataloginformation_schema_pg_foreign_tablesbsql_identifierd +authorization_identifier0@R4 + +pg_cataloginformation_schema_pg_foreign_tablesbsql_identifier— +3 + +pg_cataloginformation_schema_pg_user_mappingsC +oid0R3 + +pg_cataloginformation_schema_pg_user_mappingsboidV + umoptions 0ÿÿÿÿÿÿÿÿÿR3 + +pg_cataloginformation_schema_pg_user_mappingsb_textF +umuser0R3 + +pg_cataloginformation_schema_pg_user_mappingsboidc +authorization_identifier0@R3 + +pg_cataloginformation_schema_pg_user_mappingsbsql_identifiera +foreign_server_catalog0@R3 + +pg_cataloginformation_schema_pg_user_mappingsbsql_identifier^ +foreign_server_name0@R3 + +pg_cataloginformation_schema_pg_user_mappingsbsql_identifierS +srvowner0@R3 + +pg_cataloginformation_schema_pg_user_mappingsbsql_identifierü +C + +pg_cataloginformation_schema!administrable_role_authorizationsb +grantee0@RC + +pg_cataloginformation_schema!administrable_role_authorizationsbsql_identifierd + role_name0@RC + +pg_cataloginformation_schema!administrable_role_authorizationsbsql_identifierk + is_grantable0ÿÿÿÿÿÿÿÿÿRC + +pg_cataloginformation_schema!administrable_role_authorizationsb  yes_or_no¸ +2 + +pg_cataloginformation_schemaapplicable_rolesQ +grantee0@R2 + +pg_cataloginformation_schemaapplicable_rolesbsql_identifierS + role_name0@R2 + +pg_cataloginformation_schemaapplicable_rolesbsql_identifierZ + is_grantable0ÿÿÿÿÿÿÿÿÿR2 + +pg_cataloginformation_schemaapplicable_rolesb  yes_or_noÏ +, + +pg_cataloginformation_schema +attributesO + udt_catalog0@R, + +pg_cataloginformation_schema +attributesbsql_identifierN + +udt_schema0@R, + +pg_cataloginformation_schema +attributesbsql_identifierL +udt_name0@R, + +pg_cataloginformation_schema +attributesbsql_identifierR +attribute_name0@R, + +pg_cataloginformation_schema +attributesbsql_identifierU +ordinal_position0R, + +pg_cataloginformation_schema +attributesbcardinal_number^ +attribute_default0ÿÿÿÿÿÿÿÿÿR, + +pg_cataloginformation_schema +attributesbcharacter_dataS + is_nullable0ÿÿÿÿÿÿÿÿÿR, + +pg_cataloginformation_schema +attributesb  yes_or_noV + data_type0ÿÿÿÿÿÿÿÿÿR, + +pg_cataloginformation_schema +attributesbcharacter_data] +character_maximum_length0R, + +pg_cataloginformation_schema +attributesbcardinal_number[ +character_octet_length0R, + +pg_cataloginformation_schema +attributesbcardinal_numberY +character_set_catalog0@R, + +pg_cataloginformation_schema +attributesbsql_identifierX +character_set_schema0@R, + +pg_cataloginformation_schema +attributesbsql_identifierV +character_set_name0@R, + +pg_cataloginformation_schema +attributesbsql_identifierU +collation_catalog0@R, + +pg_cataloginformation_schema +attributesbsql_identifierT +collation_schema0@R, + +pg_cataloginformation_schema +attributesbsql_identifierR +collation_name0@R, + +pg_cataloginformation_schema +attributesbsql_identifierV +numeric_precision0R, + +pg_cataloginformation_schema +attributesbcardinal_number\ +numeric_precision_radix0R, + +pg_cataloginformation_schema +attributesbcardinal_numberR + numeric_scale0R, + +pg_cataloginformation_schema +attributesbcardinal_numberW +datetime_precision0R, + +pg_cataloginformation_schema +attributesbcardinal_numberZ + interval_type0ÿÿÿÿÿÿÿÿÿR, + +pg_cataloginformation_schema +attributesbcharacter_dataW +interval_precision0R, + +pg_cataloginformation_schema +attributesbcardinal_numberY +attribute_udt_catalog0@R, + +pg_cataloginformation_schema +attributesbsql_identifierX +attribute_udt_schema0@R, + +pg_cataloginformation_schema +attributesbsql_identifierV +attribute_udt_name0@R, + +pg_cataloginformation_schema +attributesbsql_identifierQ + scope_catalog0@R, + +pg_cataloginformation_schema +attributesbsql_identifierP + scope_schema0@R, + +pg_cataloginformation_schema +attributesbsql_identifierN + +scope_name0@R, + +pg_cataloginformation_schema +attributesbsql_identifierX +maximum_cardinality0R, + +pg_cataloginformation_schema +attributesbcardinal_numberR +dtd_identifier0@R, + +pg_cataloginformation_schema +attributesbsql_identifierf +is_derived_reference_attribute0ÿÿÿÿÿÿÿÿÿR, + +pg_cataloginformation_schema +attributesb  yes_or_no +0 + +pg_cataloginformation_schemacharacter_sets] +character_set_catalog0@R0 + +pg_cataloginformation_schemacharacter_setsbsql_identifier\ +character_set_schema0@R0 + +pg_cataloginformation_schemacharacter_setsbsql_identifierZ +character_set_name0@R0 + +pg_cataloginformation_schemacharacter_setsbsql_identifier\ +character_repertoire0@R0 + +pg_cataloginformation_schemacharacter_setsbsql_identifierS + form_of_use0@R0 + +pg_cataloginformation_schemacharacter_setsbsql_identifier_ +default_collate_catalog0@R0 + +pg_cataloginformation_schemacharacter_setsbsql_identifier^ +default_collate_schema0@R0 + +pg_cataloginformation_schemacharacter_setsbsql_identifier\ +default_collate_name0@R0 + +pg_cataloginformation_schemacharacter_setsbsql_identifier¼ +@ + +pg_cataloginformation_schemacheck_constraint_routine_usagej +constraint_catalog0@R@ + +pg_cataloginformation_schemacheck_constraint_routine_usagebsql_identifieri +constraint_schema0@R@ + +pg_cataloginformation_schemacheck_constraint_routine_usagebsql_identifierg +constraint_name0@R@ + +pg_cataloginformation_schemacheck_constraint_routine_usagebsql_identifierh +specific_catalog0@R@ + +pg_cataloginformation_schemacheck_constraint_routine_usagebsql_identifierg +specific_schema0@R@ + +pg_cataloginformation_schemacheck_constraint_routine_usagebsql_identifiere + specific_name0@R@ + +pg_cataloginformation_schemacheck_constraint_routine_usagebsql_identifier° +3 + +pg_cataloginformation_schemacheck_constraints] +constraint_catalog0@R3 + +pg_cataloginformation_schemacheck_constraintsbsql_identifier\ +constraint_schema0@R3 + +pg_cataloginformation_schemacheck_constraintsbsql_identifierZ +constraint_name0@R3 + +pg_cataloginformation_schemacheck_constraintsbsql_identifier` + check_clause0ÿÿÿÿÿÿÿÿÿR3 + +pg_cataloginformation_schemacheck_constraintsbcharacter_dataù +G + +pg_cataloginformation_schema%collation_character_set_applicabilityp +collation_catalog0@RG + +pg_cataloginformation_schema%collation_character_set_applicabilitybsql_identifiero +collation_schema0@RG + +pg_cataloginformation_schema%collation_character_set_applicabilitybsql_identifierm +collation_name0@RG + +pg_cataloginformation_schema%collation_character_set_applicabilitybsql_identifiert +character_set_catalog0@RG + +pg_cataloginformation_schema%collation_character_set_applicabilitybsql_identifiers +character_set_schema0@RG + +pg_cataloginformation_schema%collation_character_set_applicabilitybsql_identifierq +character_set_name0@RG + +pg_cataloginformation_schema%collation_character_set_applicabilitybsql_identifier‹ +, + +pg_cataloginformation_schema +collationsU +collation_catalog0@R, + +pg_cataloginformation_schema +collationsbsql_identifierT +collation_schema0@R, + +pg_cataloginformation_schema +collationsbsql_identifierR +collation_name0@R, + +pg_cataloginformation_schema +collationsbsql_identifierZ + pad_attribute0ÿÿÿÿÿÿÿÿÿR, + +pg_cataloginformation_schema +collationsbcharacter_data€ +5 + +pg_cataloginformation_schemacolumn_column_usageZ + table_catalog0@R5 + +pg_cataloginformation_schemacolumn_column_usagebsql_identifierY + table_schema0@R5 + +pg_cataloginformation_schemacolumn_column_usagebsql_identifierW + +table_name0@R5 + +pg_cataloginformation_schemacolumn_column_usagebsql_identifierX + column_name0@R5 + +pg_cataloginformation_schemacolumn_column_usagebsql_identifier] +dependent_column0@R5 + +pg_cataloginformation_schemacolumn_column_usagebsql_identifier´ +5 + +pg_cataloginformation_schemacolumn_domain_usage[ +domain_catalog0@R5 + +pg_cataloginformation_schemacolumn_domain_usagebsql_identifierZ + domain_schema0@R5 + +pg_cataloginformation_schemacolumn_domain_usagebsql_identifierX + domain_name0@R5 + +pg_cataloginformation_schemacolumn_domain_usagebsql_identifierZ + table_catalog0@R5 + +pg_cataloginformation_schemacolumn_domain_usagebsql_identifierY + table_schema0@R5 + +pg_cataloginformation_schemacolumn_domain_usagebsql_identifierW + +table_name0@R5 + +pg_cataloginformation_schemacolumn_domain_usagebsql_identifierX + column_name0@R5 + +pg_cataloginformation_schemacolumn_domain_usagebsql_identifier¼ +0 + +pg_cataloginformation_schemacolumn_optionsU + table_catalog0@R0 + +pg_cataloginformation_schemacolumn_optionsbsql_identifierT + table_schema0@R0 + +pg_cataloginformation_schemacolumn_optionsbsql_identifierR + +table_name0@R0 + +pg_cataloginformation_schemacolumn_optionsbsql_identifierS + column_name0@R0 + +pg_cataloginformation_schemacolumn_optionsbsql_identifierS + option_name0@R0 + +pg_cataloginformation_schemacolumn_optionsbsql_identifier] + option_value0ÿÿÿÿÿÿÿÿÿR0 + +pg_cataloginformation_schemacolumn_optionsbcharacter_data€ +3 + +pg_cataloginformation_schemacolumn_privilegesR +grantor0@R3 + +pg_cataloginformation_schemacolumn_privilegesbsql_identifierR +grantee0@R3 + +pg_cataloginformation_schemacolumn_privilegesbsql_identifierX + table_catalog0@R3 + +pg_cataloginformation_schemacolumn_privilegesbsql_identifierW + table_schema0@R3 + +pg_cataloginformation_schemacolumn_privilegesbsql_identifierU + +table_name0@R3 + +pg_cataloginformation_schemacolumn_privilegesbsql_identifierV + column_name0@R3 + +pg_cataloginformation_schemacolumn_privilegesbsql_identifierb +privilege_type0ÿÿÿÿÿÿÿÿÿR3 + +pg_cataloginformation_schemacolumn_privilegesbcharacter_data[ + is_grantable0ÿÿÿÿÿÿÿÿÿR3 + +pg_cataloginformation_schemacolumn_privilegesb  yes_or_no“ +2 + +pg_cataloginformation_schemacolumn_udt_usageU + udt_catalog0@R2 + +pg_cataloginformation_schemacolumn_udt_usagebsql_identifierT + +udt_schema0@R2 + +pg_cataloginformation_schemacolumn_udt_usagebsql_identifierR +udt_name0@R2 + +pg_cataloginformation_schemacolumn_udt_usagebsql_identifierW + table_catalog0@R2 + +pg_cataloginformation_schemacolumn_udt_usagebsql_identifierV + table_schema0@R2 + +pg_cataloginformation_schemacolumn_udt_usagebsql_identifierT + +table_name0@R2 + +pg_cataloginformation_schemacolumn_udt_usagebsql_identifierU + column_name0@R2 + +pg_cataloginformation_schemacolumn_udt_usagebsql_identifier· +) + +pg_cataloginformation_schemacolumnsN + table_catalog0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierM + table_schema0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierK + +table_name0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierL + column_name0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierR +ordinal_position0R) + +pg_cataloginformation_schemacolumnsbcardinal_numberX +column_default0ÿÿÿÿÿÿÿÿÿR) + +pg_cataloginformation_schemacolumnsbcharacter_dataP + is_nullable0ÿÿÿÿÿÿÿÿÿR) + +pg_cataloginformation_schemacolumnsb  yes_or_noS + data_type0ÿÿÿÿÿÿÿÿÿR) + +pg_cataloginformation_schemacolumnsbcharacter_dataZ +character_maximum_length0R) + +pg_cataloginformation_schemacolumnsbcardinal_numberX +character_octet_length0R) + +pg_cataloginformation_schemacolumnsbcardinal_numberS +numeric_precision0R) + +pg_cataloginformation_schemacolumnsbcardinal_numberY +numeric_precision_radix0R) + +pg_cataloginformation_schemacolumnsbcardinal_numberO + numeric_scale0R) + +pg_cataloginformation_schemacolumnsbcardinal_numberT +datetime_precision0R) + +pg_cataloginformation_schemacolumnsbcardinal_numberW + interval_type0ÿÿÿÿÿÿÿÿÿR) + +pg_cataloginformation_schemacolumnsbcharacter_dataT +interval_precision0R) + +pg_cataloginformation_schemacolumnsbcardinal_numberV +character_set_catalog0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierU +character_set_schema0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierS +character_set_name0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierR +collation_catalog0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierQ +collation_schema0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierO +collation_name0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierO +domain_catalog0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierN + domain_schema0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierL + domain_name0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierL + udt_catalog0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierK + +udt_schema0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierI +udt_name0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierN + scope_catalog0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierM + scope_schema0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierK + +scope_name0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierU +maximum_cardinality0R) + +pg_cataloginformation_schemacolumnsbcardinal_numberO +dtd_identifier0@R) + +pg_cataloginformation_schemacolumnsbsql_identifierX +is_self_referencing0ÿÿÿÿÿÿÿÿÿR) + +pg_cataloginformation_schemacolumnsb  yes_or_noP + is_identity0ÿÿÿÿÿÿÿÿÿR) + +pg_cataloginformation_schemacolumnsb  yes_or_no] +identity_generation0ÿÿÿÿÿÿÿÿÿR) + +pg_cataloginformation_schemacolumnsbcharacter_dataX +identity_start0ÿÿÿÿÿÿÿÿÿR) + +pg_cataloginformation_schemacolumnsbcharacter_data\ +identity_increment0ÿÿÿÿÿÿÿÿÿR) + +pg_cataloginformation_schemacolumnsbcharacter_dataZ +identity_maximum0ÿÿÿÿÿÿÿÿÿR) + +pg_cataloginformation_schemacolumnsbcharacter_dataZ +identity_minimum0ÿÿÿÿÿÿÿÿÿR) + +pg_cataloginformation_schemacolumnsbcharacter_dataS +identity_cycle0ÿÿÿÿÿÿÿÿÿR) + +pg_cataloginformation_schemacolumnsb  yes_or_noV + is_generated0ÿÿÿÿÿÿÿÿÿR) + +pg_cataloginformation_schemacolumnsbcharacter_data_ +generation_expression0ÿÿÿÿÿÿÿÿÿR) + +pg_cataloginformation_schemacolumnsbcharacter_dataQ + is_updatable0ÿÿÿÿÿÿÿÿÿR) + +pg_cataloginformation_schemacolumnsb  yes_or_noà +9 + +pg_cataloginformation_schemaconstraint_column_usage^ + table_catalog0@R9 + +pg_cataloginformation_schemaconstraint_column_usagebsql_identifier] + table_schema0@R9 + +pg_cataloginformation_schemaconstraint_column_usagebsql_identifier[ + +table_name0@R9 + +pg_cataloginformation_schemaconstraint_column_usagebsql_identifier\ + column_name0@R9 + +pg_cataloginformation_schemaconstraint_column_usagebsql_identifierc +constraint_catalog0@R9 + +pg_cataloginformation_schemaconstraint_column_usagebsql_identifierb +constraint_schema0@R9 + +pg_cataloginformation_schemaconstraint_column_usagebsql_identifier` +constraint_name0@R9 + +pg_cataloginformation_schemaconstraint_column_usagebsql_identifierû +8 + +pg_cataloginformation_schemaconstraint_table_usage] + table_catalog0@R8 + +pg_cataloginformation_schemaconstraint_table_usagebsql_identifier\ + table_schema0@R8 + +pg_cataloginformation_schemaconstraint_table_usagebsql_identifierZ + +table_name0@R8 + +pg_cataloginformation_schemaconstraint_table_usagebsql_identifierb +constraint_catalog0@R8 + +pg_cataloginformation_schemaconstraint_table_usagebsql_identifiera +constraint_schema0@R8 + +pg_cataloginformation_schemaconstraint_table_usagebsql_identifier_ +constraint_name0@R8 + +pg_cataloginformation_schemaconstraint_table_usagebsql_identifier +6 + +pg_cataloginformation_schemadata_type_privileges\ +object_catalog0@R6 + +pg_cataloginformation_schemadata_type_privilegesbsql_identifier[ + object_schema0@R6 + +pg_cataloginformation_schemadata_type_privilegesbsql_identifierY + object_name0@R6 + +pg_cataloginformation_schemadata_type_privilegesbsql_identifierb + object_type0ÿÿÿÿÿÿÿÿÿR6 + +pg_cataloginformation_schemadata_type_privilegesbcharacter_data\ +dtd_identifier0@R6 + +pg_cataloginformation_schemadata_type_privilegesbsql_identifier¥ +4 + +pg_cataloginformation_schemadomain_constraints^ +constraint_catalog0@R4 + +pg_cataloginformation_schemadomain_constraintsbsql_identifier] +constraint_schema0@R4 + +pg_cataloginformation_schemadomain_constraintsbsql_identifier[ +constraint_name0@R4 + +pg_cataloginformation_schemadomain_constraintsbsql_identifierZ +domain_catalog0@R4 + +pg_cataloginformation_schemadomain_constraintsbsql_identifierY + domain_schema0@R4 + +pg_cataloginformation_schemadomain_constraintsbsql_identifierW + domain_name0@R4 + +pg_cataloginformation_schemadomain_constraintsbsql_identifier] + is_deferrable0ÿÿÿÿÿÿÿÿÿR4 + +pg_cataloginformation_schemadomain_constraintsb  yes_or_nob +initially_deferred0ÿÿÿÿÿÿÿÿÿR4 + +pg_cataloginformation_schemadomain_constraintsb  yes_or_no¿ +2 + +pg_cataloginformation_schemadomain_udt_usageU + udt_catalog0@R2 + +pg_cataloginformation_schemadomain_udt_usagebsql_identifierT + +udt_schema0@R2 + +pg_cataloginformation_schemadomain_udt_usagebsql_identifierR +udt_name0@R2 + +pg_cataloginformation_schemadomain_udt_usagebsql_identifierX +domain_catalog0@R2 + +pg_cataloginformation_schemadomain_udt_usagebsql_identifierW + domain_schema0@R2 + +pg_cataloginformation_schemadomain_udt_usagebsql_identifierU + domain_name0@R2 + +pg_cataloginformation_schemadomain_udt_usagebsql_identifierû +) + +pg_cataloginformation_schemadomainsO +domain_catalog0@R) + +pg_cataloginformation_schemadomainsbsql_identifierN + domain_schema0@R) + +pg_cataloginformation_schemadomainsbsql_identifierL + domain_name0@R) + +pg_cataloginformation_schemadomainsbsql_identifierS + data_type0ÿÿÿÿÿÿÿÿÿR) + +pg_cataloginformation_schemadomainsbcharacter_dataZ +character_maximum_length0R) + +pg_cataloginformation_schemadomainsbcardinal_numberX +character_octet_length0R) + +pg_cataloginformation_schemadomainsbcardinal_numberV +character_set_catalog0@R) + +pg_cataloginformation_schemadomainsbsql_identifierU +character_set_schema0@R) + +pg_cataloginformation_schemadomainsbsql_identifierS +character_set_name0@R) + +pg_cataloginformation_schemadomainsbsql_identifierR +collation_catalog0@R) + +pg_cataloginformation_schemadomainsbsql_identifierQ +collation_schema0@R) + +pg_cataloginformation_schemadomainsbsql_identifierO +collation_name0@R) + +pg_cataloginformation_schemadomainsbsql_identifierS +numeric_precision0R) + +pg_cataloginformation_schemadomainsbcardinal_numberY +numeric_precision_radix0R) + +pg_cataloginformation_schemadomainsbcardinal_numberO + numeric_scale0R) + +pg_cataloginformation_schemadomainsbcardinal_numberT +datetime_precision0R) + +pg_cataloginformation_schemadomainsbcardinal_numberW + interval_type0ÿÿÿÿÿÿÿÿÿR) + +pg_cataloginformation_schemadomainsbcharacter_dataT +interval_precision0R) + +pg_cataloginformation_schemadomainsbcardinal_numberX +domain_default0ÿÿÿÿÿÿÿÿÿR) + +pg_cataloginformation_schemadomainsbcharacter_dataL + udt_catalog0@R) + +pg_cataloginformation_schemadomainsbsql_identifierK + +udt_schema0@R) + +pg_cataloginformation_schemadomainsbsql_identifierI +udt_name0@R) + +pg_cataloginformation_schemadomainsbsql_identifierN + scope_catalog0@R) + +pg_cataloginformation_schemadomainsbsql_identifierM + scope_schema0@R) + +pg_cataloginformation_schemadomainsbsql_identifierK + +scope_name0@R) + +pg_cataloginformation_schemadomainsbsql_identifierU +maximum_cardinality0R) + +pg_cataloginformation_schemadomainsbcardinal_numberO +dtd_identifier0@R) + +pg_cataloginformation_schemadomainsbsql_identifierã +/ + +pg_cataloginformation_schema element_typesU +object_catalog0@R/ + +pg_cataloginformation_schema element_typesbsql_identifierT + object_schema0@R/ + +pg_cataloginformation_schema element_typesbsql_identifierR + object_name0@R/ + +pg_cataloginformation_schema element_typesbsql_identifier[ + object_type0ÿÿÿÿÿÿÿÿÿR/ + +pg_cataloginformation_schema element_typesbcharacter_dataa +collection_type_identifier0@R/ + +pg_cataloginformation_schema element_typesbsql_identifierY + data_type0ÿÿÿÿÿÿÿÿÿR/ + +pg_cataloginformation_schema element_typesbcharacter_data` +character_maximum_length0R/ + +pg_cataloginformation_schema element_typesbcardinal_number^ +character_octet_length0R/ + +pg_cataloginformation_schema element_typesbcardinal_number\ +character_set_catalog0@R/ + +pg_cataloginformation_schema element_typesbsql_identifier[ +character_set_schema0@R/ + +pg_cataloginformation_schema element_typesbsql_identifierY +character_set_name0@R/ + +pg_cataloginformation_schema element_typesbsql_identifierX +collation_catalog0@R/ + +pg_cataloginformation_schema element_typesbsql_identifierW +collation_schema0@R/ + +pg_cataloginformation_schema element_typesbsql_identifierU +collation_name0@R/ + +pg_cataloginformation_schema element_typesbsql_identifierY +numeric_precision0R/ + +pg_cataloginformation_schema element_typesbcardinal_number_ +numeric_precision_radix0R/ + +pg_cataloginformation_schema element_typesbcardinal_numberU + numeric_scale0R/ + +pg_cataloginformation_schema element_typesbcardinal_numberZ +datetime_precision0R/ + +pg_cataloginformation_schema element_typesbcardinal_number] + interval_type0ÿÿÿÿÿÿÿÿÿR/ + +pg_cataloginformation_schema element_typesbcharacter_dataZ +interval_precision0R/ + +pg_cataloginformation_schema element_typesbcardinal_number^ +domain_default0ÿÿÿÿÿÿÿÿÿR/ + +pg_cataloginformation_schema element_typesbcharacter_dataR + udt_catalog0@R/ + +pg_cataloginformation_schema element_typesbsql_identifierQ + +udt_schema0@R/ + +pg_cataloginformation_schema element_typesbsql_identifierO +udt_name0@R/ + +pg_cataloginformation_schema element_typesbsql_identifierT + scope_catalog0@R/ + +pg_cataloginformation_schema element_typesbsql_identifierS + scope_schema0@R/ + +pg_cataloginformation_schema element_typesbsql_identifierQ + +scope_name0@R/ + +pg_cataloginformation_schema element_typesbsql_identifier[ +maximum_cardinality0R/ + +pg_cataloginformation_schema element_typesbcardinal_numberU +dtd_identifier0@R/ + +pg_cataloginformation_schema element_typesbsql_identifierƒ +/ + +pg_cataloginformation_schema enabled_rolesP + role_name0@R/ + +pg_cataloginformation_schema enabled_rolesbsql_identifierõ +> + +pg_cataloginformation_schemaforeign_data_wrapper_optionsr +foreign_data_wrapper_catalog0@R> + +pg_cataloginformation_schemaforeign_data_wrapper_optionsbsql_identifiero +foreign_data_wrapper_name0@R> + +pg_cataloginformation_schemaforeign_data_wrapper_optionsbsql_identifiera + option_name0@R> + +pg_cataloginformation_schemaforeign_data_wrapper_optionsbsql_identifierk + option_value0ÿÿÿÿÿÿÿÿÿR> + +pg_cataloginformation_schemaforeign_data_wrapper_optionsbcharacter_dataÖ +7 + +pg_cataloginformation_schemaforeign_data_wrappersk +foreign_data_wrapper_catalog0@R7 + +pg_cataloginformation_schemaforeign_data_wrappersbsql_identifierh +foreign_data_wrapper_name0@R7 + +pg_cataloginformation_schemaforeign_data_wrappersbsql_identifierg +authorization_identifier0@R7 + +pg_cataloginformation_schemaforeign_data_wrappersbsql_identifierd + library_name0ÿÿÿÿÿÿÿÿÿR7 + +pg_cataloginformation_schemaforeign_data_wrappersbcharacter_datau +foreign_data_wrapper_language0ÿÿÿÿÿÿÿÿÿR7 + +pg_cataloginformation_schemaforeign_data_wrappersbcharacter_dataË +8 + +pg_cataloginformation_schemaforeign_server_optionsf +foreign_server_catalog0@R8 + +pg_cataloginformation_schemaforeign_server_optionsbsql_identifierc +foreign_server_name0@R8 + +pg_cataloginformation_schemaforeign_server_optionsbsql_identifier[ + option_name0@R8 + +pg_cataloginformation_schemaforeign_server_optionsbsql_identifiere + option_value0ÿÿÿÿÿÿÿÿÿR8 + +pg_cataloginformation_schemaforeign_server_optionsbcharacter_datañ +1 + +pg_cataloginformation_schemaforeign_servers_ +foreign_server_catalog0@R1 + +pg_cataloginformation_schemaforeign_serversbsql_identifier\ +foreign_server_name0@R1 + +pg_cataloginformation_schemaforeign_serversbsql_identifiere +foreign_data_wrapper_catalog0@R1 + +pg_cataloginformation_schemaforeign_serversbsql_identifierb +foreign_data_wrapper_name0@R1 + +pg_cataloginformation_schemaforeign_serversbsql_identifiere +foreign_server_type0ÿÿÿÿÿÿÿÿÿR1 + +pg_cataloginformation_schemaforeign_serversbcharacter_datah +foreign_server_version0ÿÿÿÿÿÿÿÿÿR1 + +pg_cataloginformation_schemaforeign_serversbcharacter_dataa +authorization_identifier0@R1 + +pg_cataloginformation_schemaforeign_serversbsql_identifier© +7 + +pg_cataloginformation_schemaforeign_table_optionsd +foreign_table_catalog0@R7 + +pg_cataloginformation_schemaforeign_table_optionsbsql_identifierc +foreign_table_schema0@R7 + +pg_cataloginformation_schemaforeign_table_optionsbsql_identifiera +foreign_table_name0@R7 + +pg_cataloginformation_schemaforeign_table_optionsbsql_identifierZ + option_name0@R7 + +pg_cataloginformation_schemaforeign_table_optionsbsql_identifierd + option_value0ÿÿÿÿÿÿÿÿÿR7 + +pg_cataloginformation_schemaforeign_table_optionsbcharacter_dataˆ +0 + +pg_cataloginformation_schemaforeign_tables] +foreign_table_catalog0@R0 + +pg_cataloginformation_schemaforeign_tablesbsql_identifier\ +foreign_table_schema0@R0 + +pg_cataloginformation_schemaforeign_tablesbsql_identifierZ +foreign_table_name0@R0 + +pg_cataloginformation_schemaforeign_tablesbsql_identifier^ +foreign_server_catalog0@R0 + +pg_cataloginformation_schemaforeign_tablesbsql_identifier[ +foreign_server_name0@R0 + +pg_cataloginformation_schemaforeign_tablesbsql_identifierª +A + +pg_cataloginformation_schemainformation_schema_catalog_namee + catalog_name0@RA + +pg_cataloginformation_schemainformation_schema_catalog_namebsql_identifierï +2 + +pg_cataloginformation_schemakey_column_usage\ +constraint_catalog0@R2 + +pg_cataloginformation_schemakey_column_usagebsql_identifier[ +constraint_schema0@R2 + +pg_cataloginformation_schemakey_column_usagebsql_identifierY +constraint_name0@R2 + +pg_cataloginformation_schemakey_column_usagebsql_identifierW + table_catalog0@R2 + +pg_cataloginformation_schemakey_column_usagebsql_identifierV + table_schema0@R2 + +pg_cataloginformation_schemakey_column_usagebsql_identifierT + +table_name0@R2 + +pg_cataloginformation_schemakey_column_usagebsql_identifierU + column_name0@R2 + +pg_cataloginformation_schemakey_column_usagebsql_identifier[ +ordinal_position0R2 + +pg_cataloginformation_schemakey_column_usagebcardinal_numberh +position_in_unique_constraint0R2 + +pg_cataloginformation_schemakey_column_usagebcardinal_number‡ +, + +pg_cataloginformation_schema +parametersT +specific_catalog0@R, + +pg_cataloginformation_schema +parametersbsql_identifierS +specific_schema0@R, + +pg_cataloginformation_schema +parametersbsql_identifierQ + specific_name0@R, + +pg_cataloginformation_schema +parametersbsql_identifierU +ordinal_position0R, + +pg_cataloginformation_schema +parametersbcardinal_number[ +parameter_mode0ÿÿÿÿÿÿÿÿÿR, + +pg_cataloginformation_schema +parametersbcharacter_dataQ + is_result0ÿÿÿÿÿÿÿÿÿR, + +pg_cataloginformation_schema +parametersb  yes_or_noR + +as_locator0ÿÿÿÿÿÿÿÿÿR, + +pg_cataloginformation_schema +parametersb  yes_or_noR +parameter_name0@R, + +pg_cataloginformation_schema +parametersbsql_identifierV + data_type0ÿÿÿÿÿÿÿÿÿR, + +pg_cataloginformation_schema +parametersbcharacter_data] +character_maximum_length0R, + +pg_cataloginformation_schema +parametersbcardinal_number[ +character_octet_length0R, + +pg_cataloginformation_schema +parametersbcardinal_numberY +character_set_catalog0@R, + +pg_cataloginformation_schema +parametersbsql_identifierX +character_set_schema0@R, + +pg_cataloginformation_schema +parametersbsql_identifierV +character_set_name0@R, + +pg_cataloginformation_schema +parametersbsql_identifierU +collation_catalog0@R, + +pg_cataloginformation_schema +parametersbsql_identifierT +collation_schema0@R, + +pg_cataloginformation_schema +parametersbsql_identifierR +collation_name0@R, + +pg_cataloginformation_schema +parametersbsql_identifierV +numeric_precision0R, + +pg_cataloginformation_schema +parametersbcardinal_number\ +numeric_precision_radix0R, + +pg_cataloginformation_schema +parametersbcardinal_numberR + numeric_scale0R, + +pg_cataloginformation_schema +parametersbcardinal_numberW +datetime_precision0R, + +pg_cataloginformation_schema +parametersbcardinal_numberZ + interval_type0ÿÿÿÿÿÿÿÿÿR, + +pg_cataloginformation_schema +parametersbcharacter_dataW +interval_precision0R, + +pg_cataloginformation_schema +parametersbcardinal_numberO + udt_catalog0@R, + +pg_cataloginformation_schema +parametersbsql_identifierN + +udt_schema0@R, + +pg_cataloginformation_schema +parametersbsql_identifierL +udt_name0@R, + +pg_cataloginformation_schema +parametersbsql_identifierQ + scope_catalog0@R, + +pg_cataloginformation_schema +parametersbsql_identifierP + scope_schema0@R, + +pg_cataloginformation_schema +parametersbsql_identifierN + +scope_name0@R, + +pg_cataloginformation_schema +parametersbsql_identifierX +maximum_cardinality0R, + +pg_cataloginformation_schema +parametersbcardinal_numberR +dtd_identifier0@R, + +pg_cataloginformation_schema +parametersbsql_identifier^ +parameter_default0ÿÿÿÿÿÿÿÿÿR, + +pg_cataloginformation_schema +parametersbcharacter_dataÜ +9 + +pg_cataloginformation_schemareferential_constraintsc +constraint_catalog0@R9 + +pg_cataloginformation_schemareferential_constraintsbsql_identifierb +constraint_schema0@R9 + +pg_cataloginformation_schemareferential_constraintsbsql_identifier` +constraint_name0@R9 + +pg_cataloginformation_schemareferential_constraintsbsql_identifierj +unique_constraint_catalog0@R9 + +pg_cataloginformation_schemareferential_constraintsbsql_identifieri +unique_constraint_schema0@R9 + +pg_cataloginformation_schemareferential_constraintsbsql_identifierg +unique_constraint_name0@R9 + +pg_cataloginformation_schemareferential_constraintsbsql_identifierf + match_option0ÿÿÿÿÿÿÿÿÿR9 + +pg_cataloginformation_schemareferential_constraintsbcharacter_datae + update_rule0ÿÿÿÿÿÿÿÿÿR9 + +pg_cataloginformation_schemareferential_constraintsbcharacter_datae + delete_rule0ÿÿÿÿÿÿÿÿÿR9 + +pg_cataloginformation_schemareferential_constraintsbcharacter_data‰ +4 + +pg_cataloginformation_schemarole_column_grantsS +grantor0@R4 + +pg_cataloginformation_schemarole_column_grantsbsql_identifierS +grantee0@R4 + +pg_cataloginformation_schemarole_column_grantsbsql_identifierY + table_catalog0@R4 + +pg_cataloginformation_schemarole_column_grantsbsql_identifierX + table_schema0@R4 + +pg_cataloginformation_schemarole_column_grantsbsql_identifierV + +table_name0@R4 + +pg_cataloginformation_schemarole_column_grantsbsql_identifierW + column_name0@R4 + +pg_cataloginformation_schemarole_column_grantsbsql_identifierc +privilege_type0ÿÿÿÿÿÿÿÿÿR4 + +pg_cataloginformation_schemarole_column_grantsbcharacter_data\ + is_grantable0ÿÿÿÿÿÿÿÿÿR4 + +pg_cataloginformation_schemarole_column_grantsb  yes_or_no× +5 + +pg_cataloginformation_schemarole_routine_grantsT +grantor0@R5 + +pg_cataloginformation_schemarole_routine_grantsbsql_identifierT +grantee0@R5 + +pg_cataloginformation_schemarole_routine_grantsbsql_identifier] +specific_catalog0@R5 + +pg_cataloginformation_schemarole_routine_grantsbsql_identifier\ +specific_schema0@R5 + +pg_cataloginformation_schemarole_routine_grantsbsql_identifierZ + specific_name0@R5 + +pg_cataloginformation_schemarole_routine_grantsbsql_identifier\ +routine_catalog0@R5 + +pg_cataloginformation_schemarole_routine_grantsbsql_identifier[ +routine_schema0@R5 + +pg_cataloginformation_schemarole_routine_grantsbsql_identifierY + routine_name0@R5 + +pg_cataloginformation_schemarole_routine_grantsbsql_identifierd +privilege_type0ÿÿÿÿÿÿÿÿÿR5 + +pg_cataloginformation_schemarole_routine_grantsbcharacter_data] + is_grantable0ÿÿÿÿÿÿÿÿÿR5 + +pg_cataloginformation_schemarole_routine_grantsb  yes_or_no‡ +3 + +pg_cataloginformation_schemarole_table_grantsR +grantor0@R3 + +pg_cataloginformation_schemarole_table_grantsbsql_identifierR +grantee0@R3 + +pg_cataloginformation_schemarole_table_grantsbsql_identifierX + table_catalog0@R3 + +pg_cataloginformation_schemarole_table_grantsbsql_identifierW + table_schema0@R3 + +pg_cataloginformation_schemarole_table_grantsbsql_identifierU + +table_name0@R3 + +pg_cataloginformation_schemarole_table_grantsbsql_identifierb +privilege_type0ÿÿÿÿÿÿÿÿÿR3 + +pg_cataloginformation_schemarole_table_grantsbcharacter_data[ + is_grantable0ÿÿÿÿÿÿÿÿÿR3 + +pg_cataloginformation_schemarole_table_grantsb  yes_or_no] +with_hierarchy0ÿÿÿÿÿÿÿÿÿR3 + +pg_cataloginformation_schemarole_table_grantsb  yes_or_no’ +1 + +pg_cataloginformation_schemarole_udt_grantsP +grantor0@R1 + +pg_cataloginformation_schemarole_udt_grantsbsql_identifierP +grantee0@R1 + +pg_cataloginformation_schemarole_udt_grantsbsql_identifierT + udt_catalog0@R1 + +pg_cataloginformation_schemarole_udt_grantsbsql_identifierS + +udt_schema0@R1 + +pg_cataloginformation_schemarole_udt_grantsbsql_identifierQ +udt_name0@R1 + +pg_cataloginformation_schemarole_udt_grantsbsql_identifier` +privilege_type0ÿÿÿÿÿÿÿÿÿR1 + +pg_cataloginformation_schemarole_udt_grantsbcharacter_dataY + is_grantable0ÿÿÿÿÿÿÿÿÿR1 + +pg_cataloginformation_schemarole_udt_grantsb  yes_or_noŒ +3 + +pg_cataloginformation_schemarole_usage_grantsR +grantor0@R3 + +pg_cataloginformation_schemarole_usage_grantsbsql_identifierR +grantee0@R3 + +pg_cataloginformation_schemarole_usage_grantsbsql_identifierY +object_catalog0@R3 + +pg_cataloginformation_schemarole_usage_grantsbsql_identifierX + object_schema0@R3 + +pg_cataloginformation_schemarole_usage_grantsbsql_identifierV + object_name0@R3 + +pg_cataloginformation_schemarole_usage_grantsbsql_identifier_ + object_type0ÿÿÿÿÿÿÿÿÿR3 + +pg_cataloginformation_schemarole_usage_grantsbcharacter_datab +privilege_type0ÿÿÿÿÿÿÿÿÿR3 + +pg_cataloginformation_schemarole_usage_grantsbcharacter_data[ + is_grantable0ÿÿÿÿÿÿÿÿÿR3 + +pg_cataloginformation_schemarole_usage_grantsb  yes_or_noÛ +6 + +pg_cataloginformation_schemaroutine_column_usage^ +specific_catalog0@R6 + +pg_cataloginformation_schemaroutine_column_usagebsql_identifier] +specific_schema0@R6 + +pg_cataloginformation_schemaroutine_column_usagebsql_identifier[ + specific_name0@R6 + +pg_cataloginformation_schemaroutine_column_usagebsql_identifier] +routine_catalog0@R6 + +pg_cataloginformation_schemaroutine_column_usagebsql_identifier\ +routine_schema0@R6 + +pg_cataloginformation_schemaroutine_column_usagebsql_identifierZ + routine_name0@R6 + +pg_cataloginformation_schemaroutine_column_usagebsql_identifier[ + table_catalog0@R6 + +pg_cataloginformation_schemaroutine_column_usagebsql_identifierZ + table_schema0@R6 + +pg_cataloginformation_schemaroutine_column_usagebsql_identifierX + +table_name0@R6 + +pg_cataloginformation_schemaroutine_column_usagebsql_identifierY + column_name0@R6 + +pg_cataloginformation_schemaroutine_column_usagebsql_identifierÌ +4 + +pg_cataloginformation_schemaroutine_privilegesS +grantor0@R4 + +pg_cataloginformation_schemaroutine_privilegesbsql_identifierS +grantee0@R4 + +pg_cataloginformation_schemaroutine_privilegesbsql_identifier\ +specific_catalog0@R4 + +pg_cataloginformation_schemaroutine_privilegesbsql_identifier[ +specific_schema0@R4 + +pg_cataloginformation_schemaroutine_privilegesbsql_identifierY + specific_name0@R4 + +pg_cataloginformation_schemaroutine_privilegesbsql_identifier[ +routine_catalog0@R4 + +pg_cataloginformation_schemaroutine_privilegesbsql_identifierZ +routine_schema0@R4 + +pg_cataloginformation_schemaroutine_privilegesbsql_identifierX + routine_name0@R4 + +pg_cataloginformation_schemaroutine_privilegesbsql_identifierc +privilege_type0ÿÿÿÿÿÿÿÿÿR4 + +pg_cataloginformation_schemaroutine_privilegesbcharacter_data\ + is_grantable0ÿÿÿÿÿÿÿÿÿR4 + +pg_cataloginformation_schemaroutine_privilegesb  yes_or_noô +7 + +pg_cataloginformation_schemaroutine_routine_usage_ +specific_catalog0@R7 + +pg_cataloginformation_schemaroutine_routine_usagebsql_identifier^ +specific_schema0@R7 + +pg_cataloginformation_schemaroutine_routine_usagebsql_identifier\ + specific_name0@R7 + +pg_cataloginformation_schemaroutine_routine_usagebsql_identifier^ +routine_catalog0@R7 + +pg_cataloginformation_schemaroutine_routine_usagebsql_identifier] +routine_schema0@R7 + +pg_cataloginformation_schemaroutine_routine_usagebsql_identifier[ + routine_name0@R7 + +pg_cataloginformation_schemaroutine_routine_usagebsql_identifier +8 + +pg_cataloginformation_schemaroutine_sequence_usage` +specific_catalog0@R8 + +pg_cataloginformation_schemaroutine_sequence_usagebsql_identifier_ +specific_schema0@R8 + +pg_cataloginformation_schemaroutine_sequence_usagebsql_identifier] + specific_name0@R8 + +pg_cataloginformation_schemaroutine_sequence_usagebsql_identifier_ +routine_catalog0@R8 + +pg_cataloginformation_schemaroutine_sequence_usagebsql_identifier^ +routine_schema0@R8 + +pg_cataloginformation_schemaroutine_sequence_usagebsql_identifier\ + routine_name0@R8 + +pg_cataloginformation_schemaroutine_sequence_usagebsql_identifier` +sequence_catalog0@R8 + +pg_cataloginformation_schemaroutine_sequence_usagebsql_identifier_ +sequence_schema0@R8 + +pg_cataloginformation_schemaroutine_sequence_usagebsql_identifier] + sequence_name0@R8 + +pg_cataloginformation_schemaroutine_sequence_usagebsql_identifierö +5 + +pg_cataloginformation_schemaroutine_table_usage] +specific_catalog0@R5 + +pg_cataloginformation_schemaroutine_table_usagebsql_identifier\ +specific_schema0@R5 + +pg_cataloginformation_schemaroutine_table_usagebsql_identifierZ + specific_name0@R5 + +pg_cataloginformation_schemaroutine_table_usagebsql_identifier\ +routine_catalog0@R5 + +pg_cataloginformation_schemaroutine_table_usagebsql_identifier[ +routine_schema0@R5 + +pg_cataloginformation_schemaroutine_table_usagebsql_identifierY + routine_name0@R5 + +pg_cataloginformation_schemaroutine_table_usagebsql_identifierZ + table_catalog0@R5 + +pg_cataloginformation_schemaroutine_table_usagebsql_identifierY + table_schema0@R5 + +pg_cataloginformation_schemaroutine_table_usagebsql_identifierW + +table_name0@R5 + +pg_cataloginformation_schemaroutine_table_usagebsql_identifierœ9 +* + +pg_cataloginformation_schemaroutinesR +specific_catalog0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierQ +specific_schema0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierO + specific_name0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierQ +routine_catalog0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierP +routine_schema0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierN + routine_name0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierW + routine_type0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesbcharacter_dataP +module_catalog0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierO + module_schema0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierM + module_name0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierM + udt_catalog0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierL + +udt_schema0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierJ +udt_name0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierT + data_type0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesbcharacter_data[ +character_maximum_length0R* + +pg_cataloginformation_schemaroutinesbcardinal_numberY +character_octet_length0R* + +pg_cataloginformation_schemaroutinesbcardinal_numberW +character_set_catalog0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierV +character_set_schema0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierT +character_set_name0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierS +collation_catalog0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierR +collation_schema0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierP +collation_name0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierT +numeric_precision0R* + +pg_cataloginformation_schemaroutinesbcardinal_numberZ +numeric_precision_radix0R* + +pg_cataloginformation_schemaroutinesbcardinal_numberP + numeric_scale0R* + +pg_cataloginformation_schemaroutinesbcardinal_numberU +datetime_precision0R* + +pg_cataloginformation_schemaroutinesbcardinal_numberX + interval_type0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesbcharacter_dataU +interval_precision0R* + +pg_cataloginformation_schemaroutinesbcardinal_numberR +type_udt_catalog0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierQ +type_udt_schema0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierO + type_udt_name0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierO + scope_catalog0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierN + scope_schema0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierL + +scope_name0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierV +maximum_cardinality0R* + +pg_cataloginformation_schemaroutinesbcardinal_numberP +dtd_identifier0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierW + routine_body0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesbcharacter_data] +routine_definition0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesbcharacter_dataX + external_name0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesbcharacter_data\ +external_language0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesbcharacter_dataZ +parameter_style0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesbcharacter_dataV +is_deterministic0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesb  yes_or_noZ +sql_data_access0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesbcharacter_dataR + is_null_call0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesb  yes_or_noS +sql_path0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesbcharacter_dataZ +schema_level_routine0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesb  yes_or_noZ +max_dynamic_result_sets0R* + +pg_cataloginformation_schemaroutinesbcardinal_numberZ +is_user_defined_cast0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesb  yes_or_no] +is_implicitly_invocable0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesb  yes_or_noX + security_type0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesbcharacter_dataY +to_sql_specific_catalog0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierX +to_sql_specific_schema0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierV +to_sql_specific_name0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierP + +as_locator0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesb  yes_or_noE +created0R* + +pg_cataloginformation_schemaroutinesb  +time_stampJ + last_altered0R* + +pg_cataloginformation_schemaroutinesb  +time_stampY +new_savepoint_level0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesb  yes_or_noV +is_udt_dependent0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesb  yes_or_noe +result_cast_from_data_type0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesbcharacter_data\ +result_cast_as_locator0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesb  yes_or_no^ +result_cast_char_max_length0R* + +pg_cataloginformation_schemaroutinesbcardinal_number` +result_cast_char_octet_length0R* + +pg_cataloginformation_schemaroutinesbcardinal_number^ +result_cast_char_set_catalog0@R* + +pg_cataloginformation_schemaroutinesbsql_identifier] +result_cast_char_set_schema0@R* + +pg_cataloginformation_schemaroutinesbsql_identifier[ +result_cast_char_set_name0@R* + +pg_cataloginformation_schemaroutinesbsql_identifier_ +result_cast_collation_catalog0@R* + +pg_cataloginformation_schemaroutinesbsql_identifier^ +result_cast_collation_schema0@R* + +pg_cataloginformation_schemaroutinesbsql_identifier\ +result_cast_collation_name0@R* + +pg_cataloginformation_schemaroutinesbsql_identifier` +result_cast_numeric_precision0R* + +pg_cataloginformation_schemaroutinesbcardinal_numberf +#result_cast_numeric_precision_radix0R* + +pg_cataloginformation_schemaroutinesbcardinal_number\ +result_cast_numeric_scale0R* + +pg_cataloginformation_schemaroutinesbcardinal_numbera +result_cast_datetime_precision0R* + +pg_cataloginformation_schemaroutinesbcardinal_numberd +result_cast_interval_type0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaroutinesbcharacter_dataa +result_cast_interval_precision0R* + +pg_cataloginformation_schemaroutinesbcardinal_number^ +result_cast_type_udt_catalog0@R* + +pg_cataloginformation_schemaroutinesbsql_identifier] +result_cast_type_udt_schema0@R* + +pg_cataloginformation_schemaroutinesbsql_identifier[ +result_cast_type_udt_name0@R* + +pg_cataloginformation_schemaroutinesbsql_identifier[ +result_cast_scope_catalog0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierZ +result_cast_scope_schema0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierX +result_cast_scope_name0@R* + +pg_cataloginformation_schemaroutinesbsql_identifierb +result_cast_maximum_cardinality0R* + +pg_cataloginformation_schemaroutinesbcardinal_number\ +result_cast_dtd_identifier0@R* + +pg_cataloginformation_schemaroutinesbsql_identifier +* + +pg_cataloginformation_schemaschemataN + catalog_name0@R* + +pg_cataloginformation_schemaschematabsql_identifierM + schema_name0@R* + +pg_cataloginformation_schemaschematabsql_identifierN + schema_owner0@R* + +pg_cataloginformation_schemaschematabsql_identifier_ +default_character_set_catalog0@R* + +pg_cataloginformation_schemaschematabsql_identifier^ +default_character_set_schema0@R* + +pg_cataloginformation_schemaschematabsql_identifier\ +default_character_set_name0@R* + +pg_cataloginformation_schemaschematabsql_identifierS +sql_path0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schemaschematabcharacter_dataÁ ++ + +pg_cataloginformation_schema sequencesS +sequence_catalog0@R+ + +pg_cataloginformation_schema sequencesbsql_identifierR +sequence_schema0@R+ + +pg_cataloginformation_schema sequencesbsql_identifierP + sequence_name0@R+ + +pg_cataloginformation_schema sequencesbsql_identifierU + data_type0ÿÿÿÿÿÿÿÿÿR+ + +pg_cataloginformation_schema sequencesbcharacter_dataU +numeric_precision0R+ + +pg_cataloginformation_schema sequencesbcardinal_number[ +numeric_precision_radix0R+ + +pg_cataloginformation_schema sequencesbcardinal_numberQ + numeric_scale0R+ + +pg_cataloginformation_schema sequencesbcardinal_numberW + start_value0ÿÿÿÿÿÿÿÿÿR+ + +pg_cataloginformation_schema sequencesbcharacter_dataY + minimum_value0ÿÿÿÿÿÿÿÿÿR+ + +pg_cataloginformation_schema sequencesbcharacter_dataY + maximum_value0ÿÿÿÿÿÿÿÿÿR+ + +pg_cataloginformation_schema sequencesbcharacter_dataU + increment0ÿÿÿÿÿÿÿÿÿR+ + +pg_cataloginformation_schema sequencesbcharacter_dataS + cycle_option0ÿÿÿÿÿÿÿÿÿR+ + +pg_cataloginformation_schema sequencesb  yes_or_noÎ +. + +pg_cataloginformation_schema sql_featuresE +tableoid0R. + +pg_cataloginformation_schema sql_featuresboidA +cmax0R. + +pg_cataloginformation_schema sql_featuresbcidA +xmax0R. + +pg_cataloginformation_schema sql_featuresbxidA +cmin0R. + +pg_cataloginformation_schema sql_featuresbcidA +xmin0R. + +pg_cataloginformation_schema sql_featuresbxidA +ctid0R. + +pg_cataloginformation_schema sql_featuresbtidY + +feature_id0ÿÿÿÿÿÿÿÿÿR. + +pg_cataloginformation_schema sql_featuresbcharacter_data[ + feature_name0ÿÿÿÿÿÿÿÿÿR. + +pg_cataloginformation_schema sql_featuresbcharacter_data] +sub_feature_id0ÿÿÿÿÿÿÿÿÿR. + +pg_cataloginformation_schema sql_featuresbcharacter_data_ +sub_feature_name0ÿÿÿÿÿÿÿÿÿR. + +pg_cataloginformation_schema sql_featuresbcharacter_dataV + is_supported0ÿÿÿÿÿÿÿÿÿR. + +pg_cataloginformation_schema sql_featuresb  yes_or_no] +is_verified_by0ÿÿÿÿÿÿÿÿÿR. + +pg_cataloginformation_schema sql_featuresbcharacter_dataW +comments0ÿÿÿÿÿÿÿÿÿR. + +pg_cataloginformation_schema sql_featuresbcharacter_data© +9 + +pg_cataloginformation_schemasql_implementation_infoP +tableoid0R9 + +pg_cataloginformation_schemasql_implementation_infoboidL +cmax0R9 + +pg_cataloginformation_schemasql_implementation_infobcidL +xmax0R9 + +pg_cataloginformation_schemasql_implementation_infobxidL +cmin0R9 + +pg_cataloginformation_schemasql_implementation_infobcidL +xmin0R9 + +pg_cataloginformation_schemasql_implementation_infobxidL +ctid0R9 + +pg_cataloginformation_schemasql_implementation_infobtidp +implementation_info_id0ÿÿÿÿÿÿÿÿÿR9 + +pg_cataloginformation_schemasql_implementation_infobcharacter_datar +implementation_info_name0ÿÿÿÿÿÿÿÿÿR9 + +pg_cataloginformation_schemasql_implementation_infobcharacter_data_ + integer_value0R9 + +pg_cataloginformation_schemasql_implementation_infobcardinal_numberi +character_value0ÿÿÿÿÿÿÿÿÿR9 + +pg_cataloginformation_schemasql_implementation_infobcharacter_datab +comments0ÿÿÿÿÿÿÿÿÿR9 + +pg_cataloginformation_schemasql_implementation_infobcharacter_dataê ++ + +pg_cataloginformation_schema sql_partsB +tableoid0R+ + +pg_cataloginformation_schema sql_partsboid> +cmax0R+ + +pg_cataloginformation_schema sql_partsbcid> +xmax0R+ + +pg_cataloginformation_schema sql_partsbxid> +cmin0R+ + +pg_cataloginformation_schema sql_partsbcid> +xmin0R+ + +pg_cataloginformation_schema sql_partsbxid> +ctid0R+ + +pg_cataloginformation_schema sql_partsbtidV + +feature_id0ÿÿÿÿÿÿÿÿÿR+ + +pg_cataloginformation_schema sql_partsbcharacter_dataX + feature_name0ÿÿÿÿÿÿÿÿÿR+ + +pg_cataloginformation_schema sql_partsbcharacter_dataS + is_supported0ÿÿÿÿÿÿÿÿÿR+ + +pg_cataloginformation_schema sql_partsb  yes_or_noZ +is_verified_by0ÿÿÿÿÿÿÿÿÿR+ + +pg_cataloginformation_schema sql_partsbcharacter_dataT +comments0ÿÿÿÿÿÿÿÿÿR+ + +pg_cataloginformation_schema sql_partsbcharacter_data +, + +pg_cataloginformation_schema +sql_sizingC +tableoid0R, + +pg_cataloginformation_schema +sql_sizingboid? +cmax0R, + +pg_cataloginformation_schema +sql_sizingbcid? +xmax0R, + +pg_cataloginformation_schema +sql_sizingbxid? +cmin0R, + +pg_cataloginformation_schema +sql_sizingbcid? +xmin0R, + +pg_cataloginformation_schema +sql_sizingbxid? +ctid0R, + +pg_cataloginformation_schema +sql_sizingbtidN + sizing_id0R, + +pg_cataloginformation_schema +sql_sizingbcardinal_numberX + sizing_name0ÿÿÿÿÿÿÿÿÿR, + +pg_cataloginformation_schema +sql_sizingbcharacter_dataT +supported_value0R, + +pg_cataloginformation_schema +sql_sizingbcardinal_numberU +comments0ÿÿÿÿÿÿÿÿÿR, + +pg_cataloginformation_schema +sql_sizingbcharacter_data¶ +3 + +pg_cataloginformation_schematable_constraints] +constraint_catalog0@R3 + +pg_cataloginformation_schematable_constraintsbsql_identifier\ +constraint_schema0@R3 + +pg_cataloginformation_schematable_constraintsbsql_identifierZ +constraint_name0@R3 + +pg_cataloginformation_schematable_constraintsbsql_identifierX + table_catalog0@R3 + +pg_cataloginformation_schematable_constraintsbsql_identifierW + table_schema0@R3 + +pg_cataloginformation_schematable_constraintsbsql_identifierU + +table_name0@R3 + +pg_cataloginformation_schematable_constraintsbsql_identifierc +constraint_type0ÿÿÿÿÿÿÿÿÿR3 + +pg_cataloginformation_schematable_constraintsbcharacter_data\ + is_deferrable0ÿÿÿÿÿÿÿÿÿR3 + +pg_cataloginformation_schematable_constraintsb  yes_or_noa +initially_deferred0ÿÿÿÿÿÿÿÿÿR3 + +pg_cataloginformation_schematable_constraintsb  yes_or_noW +enforced0ÿÿÿÿÿÿÿÿÿR3 + +pg_cataloginformation_schematable_constraintsb  yes_or_no] +nulls_distinct0ÿÿÿÿÿÿÿÿÿR3 + +pg_cataloginformation_schematable_constraintsb  yes_or_noþ +2 + +pg_cataloginformation_schematable_privilegesQ +grantor0@R2 + +pg_cataloginformation_schematable_privilegesbsql_identifierQ +grantee0@R2 + +pg_cataloginformation_schematable_privilegesbsql_identifierW + table_catalog0@R2 + +pg_cataloginformation_schematable_privilegesbsql_identifierV + table_schema0@R2 + +pg_cataloginformation_schematable_privilegesbsql_identifierT + +table_name0@R2 + +pg_cataloginformation_schematable_privilegesbsql_identifiera +privilege_type0ÿÿÿÿÿÿÿÿÿR2 + +pg_cataloginformation_schematable_privilegesbcharacter_dataZ + is_grantable0ÿÿÿÿÿÿÿÿÿR2 + +pg_cataloginformation_schematable_privilegesb  yes_or_no\ +with_hierarchy0ÿÿÿÿÿÿÿÿÿR2 + +pg_cataloginformation_schematable_privilegesb  yes_or_no° +( + +pg_cataloginformation_schematablesM + table_catalog0@R( + +pg_cataloginformation_schematablesbsql_identifierL + table_schema0@R( + +pg_cataloginformation_schematablesbsql_identifierJ + +table_name0@R( + +pg_cataloginformation_schematablesbsql_identifierS + +table_type0ÿÿÿÿÿÿÿÿÿR( + +pg_cataloginformation_schematablesbcharacter_data\ +self_referencing_column_name0@R( + +pg_cataloginformation_schematablesbsql_identifier] +reference_generation0ÿÿÿÿÿÿÿÿÿR( + +pg_cataloginformation_schematablesbcharacter_dataY +user_defined_type_catalog0@R( + +pg_cataloginformation_schematablesbsql_identifierX +user_defined_type_schema0@R( + +pg_cataloginformation_schematablesbsql_identifierV +user_defined_type_name0@R( + +pg_cataloginformation_schematablesbsql_identifierV +is_insertable_into0ÿÿÿÿÿÿÿÿÿR( + +pg_cataloginformation_schematablesb  yes_or_noL +is_typed0ÿÿÿÿÿÿÿÿÿR( + +pg_cataloginformation_schematablesb  yes_or_noV + commit_action0ÿÿÿÿÿÿÿÿÿR( + +pg_cataloginformation_schematablesbcharacter_dataÈ +, + +pg_cataloginformation_schema +transformsO + udt_catalog0@R, + +pg_cataloginformation_schema +transformsbsql_identifierN + +udt_schema0@R, + +pg_cataloginformation_schema +transformsbsql_identifierL +udt_name0@R, + +pg_cataloginformation_schema +transformsbsql_identifierT +specific_catalog0@R, + +pg_cataloginformation_schema +transformsbsql_identifierS +specific_schema0@R, + +pg_cataloginformation_schema +transformsbsql_identifierQ + specific_name0@R, + +pg_cataloginformation_schema +transformsbsql_identifierN + +group_name0@R, + +pg_cataloginformation_schema +transformsbsql_identifier[ +transform_type0ÿÿÿÿÿÿÿÿÿR, + +pg_cataloginformation_schema +transformsbcharacter_dataý +: + +pg_cataloginformation_schematriggered_update_columnsa +trigger_catalog0@R: + +pg_cataloginformation_schematriggered_update_columnsbsql_identifier` +trigger_schema0@R: + +pg_cataloginformation_schematriggered_update_columnsbsql_identifier^ + trigger_name0@R: + +pg_cataloginformation_schematriggered_update_columnsbsql_identifierf +event_object_catalog0@R: + +pg_cataloginformation_schematriggered_update_columnsbsql_identifiere +event_object_schema0@R: + +pg_cataloginformation_schematriggered_update_columnsbsql_identifierd +event_object_table0@R: + +pg_cataloginformation_schematriggered_update_columnsbsql_identifiere +event_object_column0@R: + +pg_cataloginformation_schematriggered_update_columnsbsql_identifier„ +* + +pg_cataloginformation_schematriggersQ +trigger_catalog0@R* + +pg_cataloginformation_schematriggersbsql_identifierP +trigger_schema0@R* + +pg_cataloginformation_schematriggersbsql_identifierN + trigger_name0@R* + +pg_cataloginformation_schematriggersbsql_identifier] +event_manipulation0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schematriggersbcharacter_dataV +event_object_catalog0@R* + +pg_cataloginformation_schematriggersbsql_identifierU +event_object_schema0@R* + +pg_cataloginformation_schematriggersbsql_identifierT +event_object_table0@R* + +pg_cataloginformation_schematriggersbsql_identifierO + action_order0R* + +pg_cataloginformation_schematriggersbcardinal_number[ +action_condition0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schematriggersbcharacter_data[ +action_statement0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schematriggersbcharacter_data] +action_orientation0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schematriggersbcharacter_dataX + action_timing0ÿÿÿÿÿÿÿÿÿR* + +pg_cataloginformation_schematriggersbcharacter_data\ +action_reference_old_table0@R* + +pg_cataloginformation_schematriggersbsql_identifier\ +action_reference_new_table0@R* + +pg_cataloginformation_schematriggersbsql_identifierZ +action_reference_old_row0@R* + +pg_cataloginformation_schematriggersbsql_identifierZ +action_reference_new_row0@R* + +pg_cataloginformation_schematriggersbsql_identifierE +created0R* + +pg_cataloginformation_schematriggersb  +time_stampŠ +0 + +pg_cataloginformation_schemaudt_privilegesO +grantor0@R0 + +pg_cataloginformation_schemaudt_privilegesbsql_identifierO +grantee0@R0 + +pg_cataloginformation_schemaudt_privilegesbsql_identifierS + udt_catalog0@R0 + +pg_cataloginformation_schemaudt_privilegesbsql_identifierR + +udt_schema0@R0 + +pg_cataloginformation_schemaudt_privilegesbsql_identifierP +udt_name0@R0 + +pg_cataloginformation_schemaudt_privilegesbsql_identifier_ +privilege_type0ÿÿÿÿÿÿÿÿÿR0 + +pg_cataloginformation_schemaudt_privilegesbcharacter_dataX + is_grantable0ÿÿÿÿÿÿÿÿÿR0 + +pg_cataloginformation_schemaudt_privilegesb  yes_or_noƒ +2 + +pg_cataloginformation_schemausage_privilegesQ +grantor0@R2 + +pg_cataloginformation_schemausage_privilegesbsql_identifierQ +grantee0@R2 + +pg_cataloginformation_schemausage_privilegesbsql_identifierX +object_catalog0@R2 + +pg_cataloginformation_schemausage_privilegesbsql_identifierW + object_schema0@R2 + +pg_cataloginformation_schemausage_privilegesbsql_identifierU + object_name0@R2 + +pg_cataloginformation_schemausage_privilegesbsql_identifier^ + object_type0ÿÿÿÿÿÿÿÿÿR2 + +pg_cataloginformation_schemausage_privilegesbcharacter_dataa +privilege_type0ÿÿÿÿÿÿÿÿÿR2 + +pg_cataloginformation_schemausage_privilegesbcharacter_dataZ + is_grantable0ÿÿÿÿÿÿÿÿÿR2 + +pg_cataloginformation_schemausage_privilegesb  yes_or_noç +4 + +pg_cataloginformation_schemauser_defined_typese +user_defined_type_catalog0@R4 + +pg_cataloginformation_schemauser_defined_typesbsql_identifierd +user_defined_type_schema0@R4 + +pg_cataloginformation_schemauser_defined_typesbsql_identifierb +user_defined_type_name0@R4 + +pg_cataloginformation_schemauser_defined_typesbsql_identifiero +user_defined_type_category0ÿÿÿÿÿÿÿÿÿR4 + +pg_cataloginformation_schemauser_defined_typesbcharacter_data_ +is_instantiable0ÿÿÿÿÿÿÿÿÿR4 + +pg_cataloginformation_schemauser_defined_typesb  yes_or_noX +is_final0ÿÿÿÿÿÿÿÿÿR4 + +pg_cataloginformation_schemauser_defined_typesb  yes_or_nob + ordering_form0ÿÿÿÿÿÿÿÿÿR4 + +pg_cataloginformation_schemauser_defined_typesbcharacter_dataf +ordering_category0ÿÿÿÿÿÿÿÿÿR4 + +pg_cataloginformation_schemauser_defined_typesbcharacter_datad +ordering_routine_catalog0@R4 + +pg_cataloginformation_schemauser_defined_typesbsql_identifierc +ordering_routine_schema0@R4 + +pg_cataloginformation_schemauser_defined_typesbsql_identifiera +ordering_routine_name0@R4 + +pg_cataloginformation_schemauser_defined_typesbsql_identifierc +reference_type0ÿÿÿÿÿÿÿÿÿR4 + +pg_cataloginformation_schemauser_defined_typesbcharacter_data^ + data_type0ÿÿÿÿÿÿÿÿÿR4 + +pg_cataloginformation_schemauser_defined_typesbcharacter_datae +character_maximum_length0R4 + +pg_cataloginformation_schemauser_defined_typesbcardinal_numberc +character_octet_length0R4 + +pg_cataloginformation_schemauser_defined_typesbcardinal_numbera +character_set_catalog0@R4 + +pg_cataloginformation_schemauser_defined_typesbsql_identifier` +character_set_schema0@R4 + +pg_cataloginformation_schemauser_defined_typesbsql_identifier^ +character_set_name0@R4 + +pg_cataloginformation_schemauser_defined_typesbsql_identifier] +collation_catalog0@R4 + +pg_cataloginformation_schemauser_defined_typesbsql_identifier\ +collation_schema0@R4 + +pg_cataloginformation_schemauser_defined_typesbsql_identifierZ +collation_name0@R4 + +pg_cataloginformation_schemauser_defined_typesbsql_identifier^ +numeric_precision0R4 + +pg_cataloginformation_schemauser_defined_typesbcardinal_numberd +numeric_precision_radix0R4 + +pg_cataloginformation_schemauser_defined_typesbcardinal_numberZ + numeric_scale0R4 + +pg_cataloginformation_schemauser_defined_typesbcardinal_number_ +datetime_precision0R4 + +pg_cataloginformation_schemauser_defined_typesbcardinal_numberb + interval_type0ÿÿÿÿÿÿÿÿÿR4 + +pg_cataloginformation_schemauser_defined_typesbcharacter_data_ +interval_precision0R4 + +pg_cataloginformation_schemauser_defined_typesbcardinal_numbera +source_dtd_identifier0@R4 + +pg_cataloginformation_schemauser_defined_typesbsql_identifier^ +ref_dtd_identifier0@R4 + +pg_cataloginformation_schemauser_defined_typesbsql_identifier© +6 + +pg_cataloginformation_schemauser_mapping_optionsf +authorization_identifier0@R6 + +pg_cataloginformation_schemauser_mapping_optionsbsql_identifierd +foreign_server_catalog0@R6 + +pg_cataloginformation_schemauser_mapping_optionsbsql_identifiera +foreign_server_name0@R6 + +pg_cataloginformation_schemauser_mapping_optionsbsql_identifierY + option_name0@R6 + +pg_cataloginformation_schemauser_mapping_optionsbsql_identifierc + option_value0ÿÿÿÿÿÿÿÿÿR6 + +pg_cataloginformation_schemauser_mapping_optionsbcharacter_dataÍ +/ + +pg_cataloginformation_schema user_mappings_ +authorization_identifier0@R/ + +pg_cataloginformation_schema user_mappingsbsql_identifier] +foreign_server_catalog0@R/ + +pg_cataloginformation_schema user_mappingsbsql_identifierZ +foreign_server_name0@R/ + +pg_cataloginformation_schema user_mappingsbsql_identifierž +3 + +pg_cataloginformation_schemaview_column_usageW + view_catalog0@R3 + +pg_cataloginformation_schemaview_column_usagebsql_identifierV + view_schema0@R3 + +pg_cataloginformation_schemaview_column_usagebsql_identifierT + view_name0@R3 + +pg_cataloginformation_schemaview_column_usagebsql_identifierX + table_catalog0@R3 + +pg_cataloginformation_schemaview_column_usagebsql_identifierW + table_schema0@R3 + +pg_cataloginformation_schemaview_column_usagebsql_identifierU + +table_name0@R3 + +pg_cataloginformation_schemaview_column_usagebsql_identifierV + column_name0@R3 + +pg_cataloginformation_schemaview_column_usagebsql_identifierÙ +4 + +pg_cataloginformation_schemaview_routine_usageY + table_catalog0@R4 + +pg_cataloginformation_schemaview_routine_usagebsql_identifierX + table_schema0@R4 + +pg_cataloginformation_schemaview_routine_usagebsql_identifierV + +table_name0@R4 + +pg_cataloginformation_schemaview_routine_usagebsql_identifier\ +specific_catalog0@R4 + +pg_cataloginformation_schemaview_routine_usagebsql_identifier[ +specific_schema0@R4 + +pg_cataloginformation_schemaview_routine_usagebsql_identifierY + specific_name0@R4 + +pg_cataloginformation_schemaview_routine_usagebsql_identifier¿ +2 + +pg_cataloginformation_schemaview_table_usageV + view_catalog0@R2 + +pg_cataloginformation_schemaview_table_usagebsql_identifierU + view_schema0@R2 + +pg_cataloginformation_schemaview_table_usagebsql_identifierS + view_name0@R2 + +pg_cataloginformation_schemaview_table_usagebsql_identifierW + table_catalog0@R2 + +pg_cataloginformation_schemaview_table_usagebsql_identifierV + table_schema0@R2 + +pg_cataloginformation_schemaview_table_usagebsql_identifierT + +table_name0@R2 + +pg_cataloginformation_schemaview_table_usagebsql_identifier÷ +' + +pg_cataloginformation_schemaviewsL + table_catalog0@R' + +pg_cataloginformation_schemaviewsbsql_identifierK + table_schema0@R' + +pg_cataloginformation_schemaviewsbsql_identifierI + +table_name0@R' + +pg_cataloginformation_schemaviewsbsql_identifierW +view_definition0ÿÿÿÿÿÿÿÿÿR' + +pg_cataloginformation_schemaviewsbcharacter_dataT + check_option0ÿÿÿÿÿÿÿÿÿR' + +pg_cataloginformation_schemaviewsbcharacter_dataO + is_updatable0ÿÿÿÿÿÿÿÿÿR' + +pg_cataloginformation_schemaviewsb  yes_or_noU +is_insertable_into0ÿÿÿÿÿÿÿÿÿR' + +pg_cataloginformation_schemaviewsb  yes_or_noW +is_trigger_updatable0ÿÿÿÿÿÿÿÿÿR' + +pg_cataloginformation_schemaviewsb  yes_or_noW +is_trigger_deletable0ÿÿÿÿÿÿÿÿÿR' + +pg_cataloginformation_schemaviewsb  yes_or_no] +is_trigger_insertable_into0ÿÿÿÿÿÿÿÿÿR' + +pg_cataloginformation_schemaviewsb  yes_or_no"¼ salesœ +sales customers8 + customer_id0ÿÿÿÿÿÿÿÿÿRsales customersbserial> +name0ÿÿÿÿÿÿÿÿÿRsales customersb +pg_catalogvarchar? +email0ÿÿÿÿÿÿÿÿÿRsales customersb +pg_catalogvarchar? +phone0ÿÿÿÿÿÿÿÿÿRsales customersb +pg_catalogvarchar? +address0ÿÿÿÿÿÿÿÿÿRsales customersb +pg_catalogvarcharI + registered_at0ÿÿÿÿÿÿÿÿÿRsales customersb +pg_catalog timestampÒ +salesproducts6 + +product_id0ÿÿÿÿÿÿÿÿÿRsalesproductsbserial= +name0ÿÿÿÿÿÿÿÿÿRsalesproductsb +pg_catalogvarcharA +category0ÿÿÿÿÿÿÿÿÿRsalesproductsb +pg_catalogvarcharC + +unit_price0ÿÿÿÿÿÿÿÿÿRsalesproductsb +pg_catalognumericD +stock_quantity0ÿÿÿÿÿÿÿÿÿRsalesproductsb +pg_catalogint43 + description0ÿÿÿÿÿÿÿÿÿRsalesproductsbtextC +added_at0ÿÿÿÿÿÿÿÿÿRsalesproductsb +pg_catalog timestampÔ +salesorders2 +order_id0ÿÿÿÿÿÿÿÿÿRsalesordersbserial? + customer_id0ÿÿÿÿÿÿÿÿÿRsalesordersb +pg_catalogint4C + +ordered_at0ÿÿÿÿÿÿÿÿÿRsalesordersb +pg_catalog timestampB + order_state0ÿÿÿÿÿÿÿÿÿRsalesordersb +pg_catalogvarcharC + total_amount0ÿÿÿÿÿÿÿÿÿRsalesordersb +pg_catalognumericç +sales order_items< + order_item_id0ÿÿÿÿÿÿÿÿÿRsales order_itemsbserialA +order_id0ÿÿÿÿÿÿÿÿÿRsales order_itemsb +pg_catalogint4C + +product_id0ÿÿÿÿÿÿÿÿÿRsales order_itemsb +pg_catalogint4A +quantity0ÿÿÿÿÿÿÿÿÿRsales order_itemsb +pg_catalogint4F + +unit_price0ÿÿÿÿÿÿÿÿÿRsales order_itemsb +pg_catalognumeric° + +ßSELECT + o.order_id, ordered_at, order_state, total_amount, order_item_id, i.quantity, i.unit_price, + p.product_id, p.name as product_name, p.category as product_category +FROM sales.orders o +JOIN sales.order_items i +USING (order_id) +JOIN sales.products p +USING (product_id) +WHERE o.customer_id = $1 +ORDER BY o.ordered_at DESC +LIMIT $3 OFFSET $2GetCustomerOrders:many"< +order_id0ÿÿÿÿÿÿÿÿÿRsalesordersbserialzorder_id"O + +ordered_at0ÿÿÿÿÿÿÿÿÿRsalesordersb +pg_catalog timestampz +ordered_at"O + order_state0ÿÿÿÿÿÿÿÿÿRsalesordersb +pg_catalogvarcharz order_state"Q + total_amount0ÿÿÿÿÿÿÿÿÿRsalesordersb +pg_catalognumericz total_amount"K + order_item_id0ÿÿÿÿÿÿÿÿÿRsales order_itemsbserialz order_item_id"K +quantity0ÿÿÿÿÿÿÿÿÿRsales order_itemsb +pg_catalogint4zquantity"R + +unit_price0ÿÿÿÿÿÿÿÿÿRsales order_itemsb +pg_catalognumericz +unit_price"B + +product_id0ÿÿÿÿÿÿÿÿÿRsalesproductsbserialz +product_id"K + product_name0ÿÿÿÿÿÿÿÿÿRsalesproductsb +pg_catalogvarcharzname"S +product_category0ÿÿÿÿÿÿÿÿÿRsalesproductsb +pg_catalogvarcharzcategory*QM + customer_id0ÿÿÿÿÿÿÿÿÿ8Rsalesordersbpg_catalog.int4z customer_id*&" +offset0ÿÿÿÿÿÿÿÿÿ8b integer*%! +limit0ÿÿÿÿÿÿÿÿÿ8b integer: query.sql§ +dINSERT INTO sales.customers (name, email, phone, address, registered_at) VALUES ($1, $2, $3, $4, $5) AddCustomers :copyfrom*GC +name0ÿÿÿÿÿÿÿÿÿRsales customersbpg_catalog.varcharzname*IE +email0ÿÿÿÿÿÿÿÿÿRsales customersbpg_catalog.varcharzemail*IE +phone0ÿÿÿÿÿÿÿÿÿRsales customersbpg_catalog.varcharzphone*KG +address0ÿÿÿÿÿÿÿÿÿRsales customersbpg_catalog.varcharzaddress*[W + registered_at0ÿÿÿÿÿÿÿÿÿRsales customersbpg_catalog.timestampz registered_at: query.sqlBsales customers³ +pINSERT INTO sales.products (name, category, unit_price, stock_quantity, description) VALUES ($1, $2, $3, $4, $5) AddProducts :copyfrom*FB +name0ÿÿÿÿÿÿÿÿÿRsalesproductsbpg_catalog.varcharzname*NJ +category0ÿÿÿÿÿÿÿÿÿRsalesproductsbpg_catalog.varcharzcategory*RN + +unit_price0ÿÿÿÿÿÿÿÿÿRsalesproductsbpg_catalog.numericz +unit_price*WS +stock_quantity0ÿÿÿÿÿÿÿÿÿRsalesproductsbpg_catalog.int4zstock_quantity*D@ + description0ÿÿÿÿÿÿÿÿÿRsalesproductsbtextz description: query.sqlBsalesproducts„ +UINSERT INTO sales.orders (customer_id, order_state, total_amount) VALUES ($1, $2, $3) AddOrders :copyfrom*OK + customer_id0ÿÿÿÿÿÿÿÿÿRsalesordersbpg_catalog.int4z customer_id*RN + order_state0ÿÿÿÿÿÿÿÿÿRsalesordersbpg_catalog.varcharz order_state*TP + total_amount0ÿÿÿÿÿÿÿÿÿRsalesordersbpg_catalog.numericz total_amount: query.sqlBsalesordersê +bINSERT INTO sales.order_items (order_id, product_id, quantity, unit_price) VALUES ($1, $2, $3, $4) AddOrderItems :copyfrom*NJ +order_id0ÿÿÿÿÿÿÿÿÿRsales order_itemsbpg_catalog.int4zorder_id*RN + +product_id0ÿÿÿÿÿÿÿÿÿRsales order_itemsbpg_catalog.int4z +product_id*NJ +quantity0ÿÿÿÿÿÿÿÿÿRsales order_itemsbpg_catalog.int4zquantity*UQ + +unit_price0ÿÿÿÿÿÿÿÿÿRsales order_itemsbpg_catalog.numericz +unit_price: query.sqlBsales order_items× +ESELECT customer_id FROM sales.customers ORDER BY customer_id LIMIT $1GetCustomerIds:many"E + customer_id0ÿÿÿÿÿÿÿÿÿRsales customersbserialz customer_id*%! +limit0ÿÿÿÿÿÿÿÿÿ8b integer: query.sqlÐ +BSELECT product_id FROM sales.products ORDER BY product_id LIMIT $1 GetProductIds:many"B + +product_id0ÿÿÿÿÿÿÿÿÿRsalesproductsbserialz +product_id*%! +limit0ÿÿÿÿÿÿÿÿÿ8b integer: query.sqlt +-SELECT COUNT(*) AS cnt FROM sales.order_itemsGetOrderItemsCount:one" +cnt0ÿÿÿÿÿÿÿÿÿ@bbigint: query.sqlÉ +CSELECT order_id FROM sales.orders ORDER BY ordered_at DESC LIMIT $1 GetOrderIds:many"< +order_id0ÿÿÿÿÿÿÿÿÿRsalesordersbserialzorder_id*%! +limit0ÿÿÿÿÿÿÿÿÿ8b integer: query.sqlà +HSELECT order_id, total_amount FROM sales.orders WHERE order_id = ANY($1)GetOrderAmounts:many"< +order_id0ÿÿÿÿÿÿÿÿÿRsalesordersbserialzorder_id"Q + total_amount0ÿÿÿÿÿÿÿÿÿRsalesordersb +pg_catalognumericz total_amount*C? + order_ids0ÿÿÿÿÿÿÿÿÿ8Rsalesordersbserialzorder_id: query.sqlÒ +LSELECT product_id, unit_price FROM sales.products WHERE product_id = ANY($1)GetProductPrices:many"B + +product_id0ÿÿÿÿÿÿÿÿÿRsalesproductsbserialz +product_id"O + +unit_price0ÿÿÿÿÿÿÿÿÿRsalesproductsb +pg_catalognumericz +unit_price*IE + product_ids0ÿÿÿÿÿÿÿÿÿ8Rsalesproductsbserialz +product_id: query.sql"v1.30.0*þ{"overrideDriverVersion":"","generateCsproj":true,"targetFramework":"net8.0","namespaceName":"PostgresSqlcImpl","useDapper":false,"overrideDapperVersion":"","overrides":null,"debugRequest":false,"useCentralPackageManagement":false,"withAsyncSuffix":true} \ No newline at end of file diff --git a/benchmark/SqliteEFCoreImpl/Models.cs b/benchmark/SqliteEFCoreImpl/Models.cs new file mode 100644 index 00000000..ce8fbd9d --- /dev/null +++ b/benchmark/SqliteEFCoreImpl/Models.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace SqliteEFCoreImpl; + +[Table("customers")] +public class Customer +{ + [Key] + [Column("customer_id")] + public int CustomerId { get; set; } + + [Required] + [Column("name")] + public string Name { get; set; } = string.Empty; + + [Required] + [Column("email")] + public string Email { get; set; } = string.Empty; + + [Required] + [Column("phone")] + public string Phone { get; set; } = string.Empty; + + [Column("address")] + public string? Address { get; set; } + + [Required] + [Column("registered_at")] + public DateTime RegisteredAt { get; set; } + + public ICollection Orders { get; set; } = new List(); +} + +[Table("products")] +public class Product +{ + [Key] + [Column("product_id")] + public int ProductId { get; set; } + + [Required] + [Column("name")] + public string Name { get; set; } = string.Empty; + + [Required] + [Column("category")] + public string Category { get; set; } = string.Empty; + + [Required] + [Column("unit_price")] + public decimal UnitPrice { get; set; } + + [Required] + [Column("stock_quantity")] + public int StockQuantity { get; set; } + + [Column("description")] + public string? Description { get; set; } + + [Required] + [Column("added_at")] + public DateTime AddedAt { get; set; } + + public ICollection OrderItems { get; set; } = new List(); +} + +[Table("orders")] +public class Order +{ + [Key] + [Column("order_id")] + public int OrderId { get; set; } + + [Required] + [Column("customer_id")] + public int CustomerId { get; set; } + + [Required] + [Column("ordered_at")] + public DateTime OrderedAt { get; set; } + + [Required] + [Column("order_state")] + public string OrderState { get; set; } = string.Empty; + + [Required] + [Column("total_amount")] + public decimal TotalAmount { get; set; } + + [ForeignKey("CustomerId")] + public Customer Customer { get; set; } = null!; + + public ICollection OrderItems { get; set; } = new List(); +} + +[Table("order_items")] +public class OrderItem +{ + [Key] + [Column("order_item_id")] + public int OrderItemId { get; set; } + + [Required] + [Column("order_id")] + public int OrderId { get; set; } + + [Required] + [Column("product_id")] + public int ProductId { get; set; } + + [Required] + [Column("quantity")] + public int Quantity { get; set; } + + [Required] + [Column("unit_price")] + public decimal UnitPrice { get; set; } + + [ForeignKey("OrderId")] + public Order Order { get; set; } = null!; + + [ForeignKey("ProductId")] + public Product Product { get; set; } = null!; +} \ No newline at end of file diff --git a/benchmark/SqliteEFCoreImpl/Queries.cs b/benchmark/SqliteEFCoreImpl/Queries.cs new file mode 100644 index 00000000..8225104b --- /dev/null +++ b/benchmark/SqliteEFCoreImpl/Queries.cs @@ -0,0 +1,138 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace SqliteEFCoreImpl; + +public class Queries +{ + private readonly SalesDbContext _dbContext; + private readonly bool _useTracking; + + public Queries(SalesDbContext dbContext, bool useTracking = false) + { + _dbContext = dbContext; + _useTracking = useTracking; + } + + public DbContext DbContext => _dbContext; + + // Result type for GetCustomerOrders matching SqlC output + public record GetCustomerOrdersRow( + int OrderId, + string OrderedAt, + string OrderState, + decimal TotalAmount, + int OrderItemId, + int Quantity, + decimal UnitPrice, + int ProductId, + string ProductName, + string ProductCategory + ); + + public record GetCustomerOrdersArgs(int CustomerId, int Offset, int Limit); + + /// + /// Get customer orders with all order items and product details, ordered by date descending with pagination + /// + public async Task> GetCustomerOrders(GetCustomerOrdersArgs args) + { + var ordersQuery = _dbContext.Orders.AsQueryable(); + var orderItemsQuery = _dbContext.OrderItems.AsQueryable(); + var productsQuery = _dbContext.Products.AsQueryable(); + + if (!_useTracking) + { + ordersQuery = ordersQuery.AsNoTracking(); + orderItemsQuery = orderItemsQuery.AsNoTracking(); + productsQuery = productsQuery.AsNoTracking(); + } + + var results = await (from o in ordersQuery + join i in orderItemsQuery on o.OrderId equals i.OrderId + join p in productsQuery on i.ProductId equals p.ProductId + where o.CustomerId == args.CustomerId + orderby o.OrderedAt descending + select new GetCustomerOrdersRow( + o.OrderId, + o.OrderedAt.ToString("yyyy-MM-dd HH:mm:ss.FFFFFFF"), + o.OrderState, + o.TotalAmount, + i.OrderItemId, + i.Quantity, + i.UnitPrice, + p.ProductId, + p.Name, + p.Category + )) + .Skip(args.Offset) + .Take(args.Limit) + .ToListAsync(); + return results; + } + + public record AddProductsArgs(string Name, string Category, decimal UnitPrice, int StockQuantity, string? Description); + + /// + /// Bulk insert products + /// + public async Task AddProducts(List args) + { + var products = args.Select(a => new Product + { + Name = a.Name, + Category = a.Category, + UnitPrice = a.UnitPrice, + StockQuantity = a.StockQuantity, + Description = a.Description, + AddedAt = DateTime.UtcNow + }).ToList(); + + await _dbContext.Products.AddRangeAsync(products); + await _dbContext.SaveChangesAsync(); + _dbContext.ChangeTracker.Clear(); + } + + public record AddOrdersArgs(int CustomerId, string OrderState, decimal TotalAmount); + + /// + /// Bulk insert orders + /// + public async Task AddOrders(List args) + { + var orders = args.Select(a => new Order + { + CustomerId = a.CustomerId, + OrderState = a.OrderState, + TotalAmount = a.TotalAmount, + OrderedAt = DateTime.UtcNow + }).ToList(); + + await _dbContext.Orders.AddRangeAsync(orders); + await _dbContext.SaveChangesAsync(); + _dbContext.ChangeTracker.Clear(); + } + + public record AddOrderItemsArgs(int OrderId, int ProductId, int Quantity, decimal UnitPrice); + + /// + /// Bulk insert order items + /// + public async Task AddOrderItems(List args) + { + var orderItems = args.Select(a => new OrderItem + { + OrderId = a.OrderId, + ProductId = a.ProductId, + Quantity = a.Quantity, + UnitPrice = a.UnitPrice + }).ToList(); + + await _dbContext.OrderItems.AddRangeAsync(orderItems); + await _dbContext.SaveChangesAsync(); + _dbContext.ChangeTracker.Clear(); + } +} \ No newline at end of file diff --git a/benchmark/SqliteEFCoreImpl/SalesDbContext.cs b/benchmark/SqliteEFCoreImpl/SalesDbContext.cs new file mode 100644 index 00000000..f5d6af70 --- /dev/null +++ b/benchmark/SqliteEFCoreImpl/SalesDbContext.cs @@ -0,0 +1,42 @@ +using Microsoft.EntityFrameworkCore; +using System; + +namespace SqliteEFCoreImpl; + +public class SalesDbContext(string connectionString) : DbContext +{ + public DbSet Customers { get; set; } = null!; + public DbSet Products { get; set; } = null!; + public DbSet Orders { get; set; } = null!; + public DbSet OrderItems { get; set; } = null!; + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + if (!optionsBuilder.IsConfigured) + optionsBuilder.UseSqlite(connectionString); + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + // Configure DateTime to TEXT conversion for SQLite + modelBuilder.Entity() + .Property(o => o.OrderedAt) + .HasConversion( + v => v.ToString("yyyy-MM-dd HH:mm:ss.FFFFFFF"), + v => DateTime.Parse(v)); + + modelBuilder.Entity() + .Property(c => c.RegisteredAt) + .HasConversion( + v => v.ToString("yyyy-MM-dd HH:mm:ss.FFFFFFF"), + v => DateTime.Parse(v)); + + modelBuilder.Entity() + .Property(p => p.AddedAt) + .HasConversion( + v => v.ToString("yyyy-MM-dd HH:mm:ss.FFFFFFF"), + v => DateTime.Parse(v)); + } +} \ No newline at end of file diff --git a/benchmark/SqliteEFCoreImpl/SqliteEFCoreImpl.csproj b/benchmark/SqliteEFCoreImpl/SqliteEFCoreImpl.csproj new file mode 100644 index 00000000..af310d07 --- /dev/null +++ b/benchmark/SqliteEFCoreImpl/SqliteEFCoreImpl.csproj @@ -0,0 +1,18 @@ + + + + net8.0 + SqliteEFCoreImpl + Library + enable + + + + + + + + + + + diff --git a/benchmark/SqliteSqlcImpl/Models.cs b/benchmark/SqliteSqlcImpl/Models.cs new file mode 100644 index 00000000..010cd8df --- /dev/null +++ b/benchmark/SqliteSqlcImpl/Models.cs @@ -0,0 +1,8 @@ +// auto-generated by sqlc - do not edit +using System.Linq; + +namespace SqliteSqlcImpl; +public readonly record struct Customer(int CustomerId, string Name, string Email, string Phone, string? Address, string RegisteredAt); +public readonly record struct Product(int ProductId, string Name, string Category, decimal UnitPrice, int StockQuantity, string? Description, string AddedAt); +public readonly record struct Order(int OrderId, int CustomerId, string OrderedAt, string OrderState, decimal TotalAmount); +public readonly record struct OrderItem(int OrderItemId, int OrderId, int ProductId, int Quantity, decimal UnitPrice); \ No newline at end of file diff --git a/benchmark/SqliteSqlcImpl/QuerySql.cs b/benchmark/SqliteSqlcImpl/QuerySql.cs new file mode 100644 index 00000000..91bfe0bf --- /dev/null +++ b/benchmark/SqliteSqlcImpl/QuerySql.cs @@ -0,0 +1,438 @@ +// auto-generated by sqlc - do not edit +// ReSharper disable UseObjectOrCollectionInitializer +// ReSharper disable UseAwaitUsing +// ReSharper disable ConvertToUsingDeclaration +// ReSharper disable NotAccessedPositionalProperty.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +using Microsoft.Data.Sqlite; +using System; +using System.Collections.Generic; +using System.Data; +using System.Threading; +using System.Threading.Tasks; + +namespace SqliteSqlcImpl; +public class QuerySql +{ + public QuerySql() + { + } + + public QuerySql(string connectionString) : this() + { + this.ConnectionString = connectionString; + } + + private QuerySql(SqliteTransaction transaction) : this() + { + this.Transaction = transaction; + } + + public static QuerySql WithTransaction(SqliteTransaction transaction) + { + return new QuerySql(transaction); + } + + private SqliteTransaction? Transaction { get; } + private string? ConnectionString { get; } + + private const string GetCustomerOrdersSql = @"SELECT + o.order_id, ordered_at, order_state, total_amount, order_item_id, i.quantity, i.unit_price, + p.product_id, p.name as product_name, p.category as product_category + FROM orders o + JOIN order_items i + USING (order_id) + JOIN products p + USING (product_id) + WHERE o.customer_id = @customer_id + ORDER BY o.ordered_at DESC + LIMIT @limit OFFSET @offset"; + public readonly record struct GetCustomerOrdersRow(int OrderId, string OrderedAt, string OrderState, decimal TotalAmount, int OrderItemId, int Quantity, decimal UnitPrice, int ProductId, string ProductName, string ProductCategory); + public readonly record struct GetCustomerOrdersArgs(int CustomerId, int Offset, int Limit); + public async Task> GetCustomerOrdersAsync(GetCustomerOrdersArgs args) + { + if (this.Transaction == null) + { + using (var connection = new SqliteConnection(ConnectionString)) + { + await connection.OpenAsync(); + using (var command = new SqliteCommand(GetCustomerOrdersSql, connection)) + { + command.Parameters.AddWithValue("@customer_id", args.CustomerId); + command.Parameters.AddWithValue("@offset", args.Offset); + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetCustomerOrdersRow { OrderId = reader.GetInt32(0), OrderedAt = reader.GetString(1), OrderState = reader.GetString(2), TotalAmount = reader.GetDecimal(3), OrderItemId = reader.GetInt32(4), Quantity = reader.GetInt32(5), UnitPrice = reader.GetDecimal(6), ProductId = reader.GetInt32(7), ProductName = reader.GetString(8), ProductCategory = reader.GetString(9) }); + return result; + } + } + } + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetCustomerOrdersSql; + command.Transaction = this.Transaction; + command.Parameters.AddWithValue("@customer_id", args.CustomerId); + command.Parameters.AddWithValue("@offset", args.Offset); + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetCustomerOrdersRow { OrderId = reader.GetInt32(0), OrderedAt = reader.GetString(1), OrderState = reader.GetString(2), TotalAmount = reader.GetDecimal(3), OrderItemId = reader.GetInt32(4), Quantity = reader.GetInt32(5), UnitPrice = reader.GetDecimal(6), ProductId = reader.GetInt32(7), ProductName = reader.GetString(8), ProductCategory = reader.GetString(9) }); + return result; + } + } + } + + private const string AddCustomersSql = "INSERT INTO customers (name, email, phone, address, registered_at) VALUES (@name, @email, @phone, @address, @registered_at)"; + public readonly record struct AddCustomersArgs(string Name, string Email, string Phone, string? Address, string RegisteredAt); + public async Task AddCustomersAsync(List args) + { + using (var connection = new SqliteConnection(ConnectionString)) + { + var transformedSql = Utils.TransformQueryForSqliteBatch(AddCustomersSql, args.Count); + await connection.OpenAsync(); + using (var command = new SqliteCommand(transformedSql, connection)) + { + for (int i = 0; i < args.Count; i++) + { + command.Parameters.AddWithValue($"@name{i}", args[i].Name); + command.Parameters.AddWithValue($"@email{i}", args[i].Email); + command.Parameters.AddWithValue($"@phone{i}", args[i].Phone); + command.Parameters.AddWithValue($"@address{i}", args[i].Address ?? (object)DBNull.Value); + command.Parameters.AddWithValue($"@registered_at{i}", args[i].RegisteredAt); + } + + await command.ExecuteScalarAsync(); + } + } + } + + private const string AddProductsSql = "INSERT INTO products (name, category, unit_price, stock_quantity, description) VALUES (@name, @category, @unit_price, @stock_quantity, @description)"; + public readonly record struct AddProductsArgs(string Name, string Category, decimal UnitPrice, int StockQuantity, string? Description); + public async Task AddProductsAsync(List args) + { + using (var connection = new SqliteConnection(ConnectionString)) + { + var transformedSql = Utils.TransformQueryForSqliteBatch(AddProductsSql, args.Count); + await connection.OpenAsync(); + using (var command = new SqliteCommand(transformedSql, connection)) + { + for (int i = 0; i < args.Count; i++) + { + command.Parameters.AddWithValue($"@name{i}", args[i].Name); + command.Parameters.AddWithValue($"@category{i}", args[i].Category); + command.Parameters.AddWithValue($"@unit_price{i}", args[i].UnitPrice); + command.Parameters.AddWithValue($"@stock_quantity{i}", args[i].StockQuantity); + command.Parameters.AddWithValue($"@description{i}", args[i].Description ?? (object)DBNull.Value); + } + + await command.ExecuteScalarAsync(); + } + } + } + + private const string AddOrdersSql = "INSERT INTO orders (customer_id, order_state, total_amount) VALUES (@customer_id, @order_state, @total_amount)"; + public readonly record struct AddOrdersArgs(int CustomerId, string OrderState, decimal TotalAmount); + public async Task AddOrdersAsync(List args) + { + using (var connection = new SqliteConnection(ConnectionString)) + { + var transformedSql = Utils.TransformQueryForSqliteBatch(AddOrdersSql, args.Count); + await connection.OpenAsync(); + using (var command = new SqliteCommand(transformedSql, connection)) + { + for (int i = 0; i < args.Count; i++) + { + command.Parameters.AddWithValue($"@customer_id{i}", args[i].CustomerId); + command.Parameters.AddWithValue($"@order_state{i}", args[i].OrderState); + command.Parameters.AddWithValue($"@total_amount{i}", args[i].TotalAmount); + } + + await command.ExecuteScalarAsync(); + } + } + } + + private const string AddOrderItemsSql = "INSERT INTO order_items (order_id, product_id, quantity, unit_price) VALUES (@order_id, @product_id, @quantity, @unit_price)"; + public readonly record struct AddOrderItemsArgs(int OrderId, int ProductId, int Quantity, decimal UnitPrice); + public async Task AddOrderItemsAsync(List args) + { + using (var connection = new SqliteConnection(ConnectionString)) + { + var transformedSql = Utils.TransformQueryForSqliteBatch(AddOrderItemsSql, args.Count); + await connection.OpenAsync(); + using (var command = new SqliteCommand(transformedSql, connection)) + { + for (int i = 0; i < args.Count; i++) + { + command.Parameters.AddWithValue($"@order_id{i}", args[i].OrderId); + command.Parameters.AddWithValue($"@product_id{i}", args[i].ProductId); + command.Parameters.AddWithValue($"@quantity{i}", args[i].Quantity); + command.Parameters.AddWithValue($"@unit_price{i}", args[i].UnitPrice); + } + + await command.ExecuteScalarAsync(); + } + } + } + + private const string GetCustomerIdsSql = "SELECT customer_id FROM customers ORDER BY customer_id LIMIT @limit"; + public readonly record struct GetCustomerIdsRow(int CustomerId); + public readonly record struct GetCustomerIdsArgs(int Limit); + public async Task> GetCustomerIdsAsync(GetCustomerIdsArgs args) + { + if (this.Transaction == null) + { + using (var connection = new SqliteConnection(ConnectionString)) + { + await connection.OpenAsync(); + using (var command = new SqliteCommand(GetCustomerIdsSql, connection)) + { + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetCustomerIdsRow { CustomerId = reader.GetInt32(0) }); + return result; + } + } + } + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetCustomerIdsSql; + command.Transaction = this.Transaction; + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetCustomerIdsRow { CustomerId = reader.GetInt32(0) }); + return result; + } + } + } + + private const string GetProductIdsSql = "SELECT product_id FROM products ORDER BY product_id LIMIT @limit"; + public readonly record struct GetProductIdsRow(int ProductId); + public readonly record struct GetProductIdsArgs(int Limit); + public async Task> GetProductIdsAsync(GetProductIdsArgs args) + { + if (this.Transaction == null) + { + using (var connection = new SqliteConnection(ConnectionString)) + { + await connection.OpenAsync(); + using (var command = new SqliteCommand(GetProductIdsSql, connection)) + { + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetProductIdsRow { ProductId = reader.GetInt32(0) }); + return result; + } + } + } + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetProductIdsSql; + command.Transaction = this.Transaction; + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetProductIdsRow { ProductId = reader.GetInt32(0) }); + return result; + } + } + } + + private const string GetOrderIdsSql = "SELECT order_id FROM orders ORDER BY order_id LIMIT @limit"; + public readonly record struct GetOrderIdsRow(int OrderId); + public readonly record struct GetOrderIdsArgs(int Limit); + public async Task> GetOrderIdsAsync(GetOrderIdsArgs args) + { + if (this.Transaction == null) + { + using (var connection = new SqliteConnection(ConnectionString)) + { + await connection.OpenAsync(); + using (var command = new SqliteCommand(GetOrderIdsSql, connection)) + { + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetOrderIdsRow { OrderId = reader.GetInt32(0) }); + return result; + } + } + } + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetOrderIdsSql; + command.Transaction = this.Transaction; + command.Parameters.AddWithValue("@limit", args.Limit); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetOrderIdsRow { OrderId = reader.GetInt32(0) }); + return result; + } + } + } + + private const string GetOrderItemsCountSql = "SELECT COUNT(*) AS cnt FROM order_items"; + public readonly record struct GetOrderItemsCountRow(int Cnt); + public async Task GetOrderItemsCountAsync() + { + if (this.Transaction == null) + { + using (var connection = new SqliteConnection(ConnectionString)) + { + await connection.OpenAsync(); + using (var command = new SqliteCommand(GetOrderItemsCountSql, connection)) + { + using (var reader = await command.ExecuteReaderAsync()) + { + if (await reader.ReadAsync()) + { + return new GetOrderItemsCountRow + { + Cnt = reader.GetInt32(0) + }; + } + } + } + }; + return null; + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetOrderItemsCountSql; + command.Transaction = this.Transaction; + using (var reader = await command.ExecuteReaderAsync()) + { + if (await reader.ReadAsync()) + { + return new GetOrderItemsCountRow + { + Cnt = reader.GetInt32(0) + }; + } + } + } + + return null; + } + + private const string GetOrderAmountsSql = "SELECT order_id, total_amount FROM orders WHERE order_id IN (/*SLICE:order_ids*/@order_id)"; + public readonly record struct GetOrderAmountsRow(int OrderId, decimal TotalAmount); + public readonly record struct GetOrderAmountsArgs(int OrderId); + public async Task> GetOrderAmountsAsync(GetOrderAmountsArgs args) + { + if (this.Transaction == null) + { + using (var connection = new SqliteConnection(ConnectionString)) + { + await connection.OpenAsync(); + using (var command = new SqliteCommand(GetOrderAmountsSql, connection)) + { + command.Parameters.AddWithValue("@order_id", args.OrderId); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetOrderAmountsRow { OrderId = reader.GetInt32(0), TotalAmount = reader.GetDecimal(1) }); + return result; + } + } + } + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetOrderAmountsSql; + command.Transaction = this.Transaction; + command.Parameters.AddWithValue("@order_id", args.OrderId); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetOrderAmountsRow { OrderId = reader.GetInt32(0), TotalAmount = reader.GetDecimal(1) }); + return result; + } + } + } + + private const string GetProductPricesSql = "SELECT product_id, unit_price FROM products WHERE product_id IN (/*SLICE:product_ids*/@product_id)"; + public readonly record struct GetProductPricesRow(int ProductId, decimal UnitPrice); + public readonly record struct GetProductPricesArgs(int ProductId); + public async Task> GetProductPricesAsync(GetProductPricesArgs args) + { + if (this.Transaction == null) + { + using (var connection = new SqliteConnection(ConnectionString)) + { + await connection.OpenAsync(); + using (var command = new SqliteCommand(GetProductPricesSql, connection)) + { + command.Parameters.AddWithValue("@product_id", args.ProductId); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetProductPricesRow { ProductId = reader.GetInt32(0), UnitPrice = reader.GetDecimal(1) }); + return result; + } + } + } + } + + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) + throw new InvalidOperationException("Transaction is provided, but its connection is null."); + using (var command = this.Transaction.Connection.CreateCommand()) + { + command.CommandText = GetProductPricesSql; + command.Transaction = this.Transaction; + command.Parameters.AddWithValue("@product_id", args.ProductId); + using (var reader = await command.ExecuteReaderAsync()) + { + var result = new List(); + while (await reader.ReadAsync()) + result.Add(new GetProductPricesRow { ProductId = reader.GetInt32(0), UnitPrice = reader.GetDecimal(1) }); + return result; + } + } + } +} \ No newline at end of file diff --git a/benchmark/SqliteSqlcImpl/SqliteSqlcImpl.csproj b/benchmark/SqliteSqlcImpl/SqliteSqlcImpl.csproj new file mode 100644 index 00000000..5bdc34c2 --- /dev/null +++ b/benchmark/SqliteSqlcImpl/SqliteSqlcImpl.csproj @@ -0,0 +1,20 @@ + + + + + + net8.0 + SqliteSqlcImpl + Library + enable + False + + + + + + + + \ No newline at end of file diff --git a/benchmark/SqliteSqlcImpl/Utils.cs b/benchmark/SqliteSqlcImpl/Utils.cs new file mode 100644 index 00000000..64f59c33 --- /dev/null +++ b/benchmark/SqliteSqlcImpl/Utils.cs @@ -0,0 +1,20 @@ +// auto-generated by sqlc - do not edit +using System; +using System.Linq; +using System.Text.RegularExpressions; + +namespace SqliteSqlcImpl; +public static class Utils +{ + private static readonly Regex ValuesRegex = new Regex(@"VALUES\s*\((?[^)]*)\)", RegexOptions.IgnoreCase); + public static string TransformQueryForSqliteBatch(string originalSql, int cntRecords) + { + var match = ValuesRegex.Match(originalSql); + if (!match.Success) + throw new ArgumentException("The query does not contain a valid VALUES clause."); + var valuesParams = match.Groups["params"].Value.Split(',').Select(p => p.Trim()).ToList(); + var batchRows = Enumerable.Range(0, cntRecords).Select(i => "(" + string.Join(", ", valuesParams.Select(p => $"{p}{i}")) + ")"); + var batchValuesClause = "VALUES " + string.Join(",\n", batchRows); + return ValuesRegex.Replace(originalSql, batchValuesClause); + } +} \ No newline at end of file diff --git a/benchmark/SqliteSqlcImpl/request.json b/benchmark/SqliteSqlcImpl/request.json new file mode 100644 index 00000000..b9b73213 --- /dev/null +++ b/benchmark/SqliteSqlcImpl/request.json @@ -0,0 +1,1011 @@ +{ + "settings": { + "version": "2", + "engine": "sqlite", + "schema": [ + "examples/config/sqlite/benchmark/schema.sql" + ], + "queries": [ + "examples/config/sqlite/benchmark/query.sql" + ], + "codegen": { + "out": "benchmark/SqliteSqlcImpl", + "plugin": "csharp", + "options": "eyJkZWJ1Z1JlcXVlc3QiOnRydWUsIm5hbWVzcGFjZU5hbWUiOiJTcWxpdGVTcWxjSW1wbCJ9", + "process": { + "cmd": "./dist/LocalRunner" + } + } + }, + "catalog": { + "defaultSchema": "main", + "schemas": [ + { + "name": "main", + "tables": [ + { + "rel": { + "name": "customers" + }, + "columns": [ + { + "name": "customer_id", + "notNull": true, + "length": -1, + "table": { + "name": "customers" + }, + "type": { + "name": "INTEGER" + } + }, + { + "name": "name", + "notNull": true, + "length": -1, + "table": { + "name": "customers" + }, + "type": { + "name": "TEXT" + } + }, + { + "name": "email", + "notNull": true, + "length": -1, + "table": { + "name": "customers" + }, + "type": { + "name": "TEXT" + } + }, + { + "name": "phone", + "notNull": true, + "length": -1, + "table": { + "name": "customers" + }, + "type": { + "name": "TEXT" + } + }, + { + "name": "address", + "length": -1, + "table": { + "name": "customers" + }, + "type": { + "name": "TEXT" + } + }, + { + "name": "registered_at", + "notNull": true, + "length": -1, + "table": { + "name": "customers" + }, + "type": { + "name": "TEXT" + } + } + ] + }, + { + "rel": { + "name": "products" + }, + "columns": [ + { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "name": "products" + }, + "type": { + "name": "INTEGER" + } + }, + { + "name": "name", + "notNull": true, + "length": -1, + "table": { + "name": "products" + }, + "type": { + "name": "TEXT" + } + }, + { + "name": "category", + "notNull": true, + "length": -1, + "table": { + "name": "products" + }, + "type": { + "name": "TEXT" + } + }, + { + "name": "unit_price", + "notNull": true, + "length": -1, + "table": { + "name": "products" + }, + "type": { + "name": "REAL" + } + }, + { + "name": "stock_quantity", + "notNull": true, + "length": -1, + "table": { + "name": "products" + }, + "type": { + "name": "INTEGER" + } + }, + { + "name": "description", + "length": -1, + "table": { + "name": "products" + }, + "type": { + "name": "TEXT" + } + }, + { + "name": "added_at", + "notNull": true, + "length": -1, + "table": { + "name": "products" + }, + "type": { + "name": "TEXT" + } + } + ] + }, + { + "rel": { + "name": "orders" + }, + "columns": [ + { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "name": "orders" + }, + "type": { + "name": "INTEGER" + } + }, + { + "name": "customer_id", + "notNull": true, + "length": -1, + "table": { + "name": "orders" + }, + "type": { + "name": "INTEGER" + } + }, + { + "name": "ordered_at", + "notNull": true, + "length": -1, + "table": { + "name": "orders" + }, + "type": { + "name": "TEXT" + } + }, + { + "name": "order_state", + "notNull": true, + "length": -1, + "table": { + "name": "orders" + }, + "type": { + "name": "TEXT" + } + }, + { + "name": "total_amount", + "notNull": true, + "length": -1, + "table": { + "name": "orders" + }, + "type": { + "name": "REAL" + } + } + ] + }, + { + "rel": { + "name": "order_items" + }, + "columns": [ + { + "name": "order_item_id", + "notNull": true, + "length": -1, + "table": { + "name": "order_items" + }, + "type": { + "name": "INTEGER" + } + }, + { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "name": "order_items" + }, + "type": { + "name": "INTEGER" + } + }, + { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "name": "order_items" + }, + "type": { + "name": "INTEGER" + } + }, + { + "name": "quantity", + "notNull": true, + "length": -1, + "table": { + "name": "order_items" + }, + "type": { + "name": "INTEGER" + } + }, + { + "name": "unit_price", + "notNull": true, + "length": -1, + "table": { + "name": "order_items" + }, + "type": { + "name": "REAL" + } + } + ] + } + ] + } + ] + }, + "queries": [ + { + "text": "SELECT \n o.order_id, ordered_at, order_state, total_amount, order_item_id, i.quantity, i.unit_price, \n p.product_id, p.name as product_name, p.category as product_category\nFROM orders o\nJOIN order_items i\nUSING (order_id)\nJOIN products p\nUSING (product_id)\nWHERE o.customer_id = ?1\nORDER BY o.ordered_at DESC\nLIMIT ?3 OFFSET ?2", + "name": "GetCustomerOrders", + "cmd": ":many", + "columns": [ + { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "name": "orders" + }, + "type": { + "name": "INTEGER" + }, + "originalName": "order_id" + }, + { + "name": "ordered_at", + "notNull": true, + "length": -1, + "table": { + "name": "orders" + }, + "type": { + "name": "TEXT" + }, + "originalName": "ordered_at" + }, + { + "name": "order_state", + "notNull": true, + "length": -1, + "table": { + "name": "orders" + }, + "type": { + "name": "TEXT" + }, + "originalName": "order_state" + }, + { + "name": "total_amount", + "notNull": true, + "length": -1, + "table": { + "name": "orders" + }, + "type": { + "name": "REAL" + }, + "originalName": "total_amount" + }, + { + "name": "order_item_id", + "notNull": true, + "length": -1, + "table": { + "name": "order_items" + }, + "type": { + "name": "INTEGER" + }, + "originalName": "order_item_id" + }, + { + "name": "quantity", + "notNull": true, + "length": -1, + "table": { + "name": "order_items" + }, + "type": { + "name": "INTEGER" + }, + "originalName": "quantity" + }, + { + "name": "unit_price", + "notNull": true, + "length": -1, + "table": { + "name": "order_items" + }, + "type": { + "name": "REAL" + }, + "originalName": "unit_price" + }, + { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "name": "products" + }, + "type": { + "name": "INTEGER" + }, + "originalName": "product_id" + }, + { + "name": "product_name", + "notNull": true, + "length": -1, + "table": { + "name": "products" + }, + "type": { + "name": "TEXT" + }, + "originalName": "name" + }, + { + "name": "product_category", + "notNull": true, + "length": -1, + "table": { + "name": "products" + }, + "type": { + "name": "TEXT" + }, + "originalName": "category" + } + ], + "parameters": [ + { + "number": 1, + "column": { + "name": "customer_id", + "notNull": true, + "length": -1, + "isNamedParam": true, + "table": { + "name": "orders" + }, + "type": { + "name": "INTEGER" + }, + "originalName": "customer_id" + } + }, + { + "number": 2, + "column": { + "name": "offset", + "notNull": true, + "length": -1, + "isNamedParam": true, + "type": { + "name": "integer" + } + } + }, + { + "number": 3, + "column": { + "name": "limit", + "notNull": true, + "length": -1, + "isNamedParam": true, + "type": { + "name": "integer" + } + } + } + ], + "filename": "query.sql" + }, + { + "text": "INSERT INTO customers (name, email, phone, address, registered_at) VALUES (?, ?, ?, ?, ?)", + "name": "AddCustomers", + "cmd": ":copyfrom", + "parameters": [ + { + "number": 1, + "column": { + "name": "name", + "notNull": true, + "length": -1, + "table": { + "schema": "main", + "name": "customers" + }, + "type": { + "name": "TEXT" + }, + "originalName": "name" + } + }, + { + "number": 2, + "column": { + "name": "email", + "notNull": true, + "length": -1, + "table": { + "schema": "main", + "name": "customers" + }, + "type": { + "name": "TEXT" + }, + "originalName": "email" + } + }, + { + "number": 3, + "column": { + "name": "phone", + "notNull": true, + "length": -1, + "table": { + "schema": "main", + "name": "customers" + }, + "type": { + "name": "TEXT" + }, + "originalName": "phone" + } + }, + { + "number": 4, + "column": { + "name": "address", + "length": -1, + "table": { + "schema": "main", + "name": "customers" + }, + "type": { + "name": "TEXT" + }, + "originalName": "address" + } + }, + { + "number": 5, + "column": { + "name": "registered_at", + "notNull": true, + "length": -1, + "table": { + "schema": "main", + "name": "customers" + }, + "type": { + "name": "TEXT" + }, + "originalName": "registered_at" + } + } + ], + "filename": "query.sql", + "insert_into_table": { + "name": "customers" + } + }, + { + "text": "INSERT INTO products (name, category, unit_price, stock_quantity, description) VALUES (?, ?, ?, ?, ?)", + "name": "AddProducts", + "cmd": ":copyfrom", + "parameters": [ + { + "number": 1, + "column": { + "name": "name", + "notNull": true, + "length": -1, + "table": { + "schema": "main", + "name": "products" + }, + "type": { + "name": "TEXT" + }, + "originalName": "name" + } + }, + { + "number": 2, + "column": { + "name": "category", + "notNull": true, + "length": -1, + "table": { + "schema": "main", + "name": "products" + }, + "type": { + "name": "TEXT" + }, + "originalName": "category" + } + }, + { + "number": 3, + "column": { + "name": "unit_price", + "notNull": true, + "length": -1, + "table": { + "schema": "main", + "name": "products" + }, + "type": { + "name": "REAL" + }, + "originalName": "unit_price" + } + }, + { + "number": 4, + "column": { + "name": "stock_quantity", + "notNull": true, + "length": -1, + "table": { + "schema": "main", + "name": "products" + }, + "type": { + "name": "INTEGER" + }, + "originalName": "stock_quantity" + } + }, + { + "number": 5, + "column": { + "name": "description", + "length": -1, + "table": { + "schema": "main", + "name": "products" + }, + "type": { + "name": "TEXT" + }, + "originalName": "description" + } + } + ], + "filename": "query.sql", + "insert_into_table": { + "name": "products" + } + }, + { + "text": "INSERT INTO orders (customer_id, order_state, total_amount) VALUES (?, ?, ?)", + "name": "AddOrders", + "cmd": ":copyfrom", + "parameters": [ + { + "number": 1, + "column": { + "name": "customer_id", + "notNull": true, + "length": -1, + "table": { + "schema": "main", + "name": "orders" + }, + "type": { + "name": "INTEGER" + }, + "originalName": "customer_id" + } + }, + { + "number": 2, + "column": { + "name": "order_state", + "notNull": true, + "length": -1, + "table": { + "schema": "main", + "name": "orders" + }, + "type": { + "name": "TEXT" + }, + "originalName": "order_state" + } + }, + { + "number": 3, + "column": { + "name": "total_amount", + "notNull": true, + "length": -1, + "table": { + "schema": "main", + "name": "orders" + }, + "type": { + "name": "REAL" + }, + "originalName": "total_amount" + } + } + ], + "filename": "query.sql", + "insert_into_table": { + "name": "orders" + } + }, + { + "text": "INSERT INTO order_items (order_id, product_id, quantity, unit_price) VALUES (?, ?, ?, ?)", + "name": "AddOrderItems", + "cmd": ":copyfrom", + "parameters": [ + { + "number": 1, + "column": { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "schema": "main", + "name": "order_items" + }, + "type": { + "name": "INTEGER" + }, + "originalName": "order_id" + } + }, + { + "number": 2, + "column": { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "schema": "main", + "name": "order_items" + }, + "type": { + "name": "INTEGER" + }, + "originalName": "product_id" + } + }, + { + "number": 3, + "column": { + "name": "quantity", + "notNull": true, + "length": -1, + "table": { + "schema": "main", + "name": "order_items" + }, + "type": { + "name": "INTEGER" + }, + "originalName": "quantity" + } + }, + { + "number": 4, + "column": { + "name": "unit_price", + "notNull": true, + "length": -1, + "table": { + "schema": "main", + "name": "order_items" + }, + "type": { + "name": "REAL" + }, + "originalName": "unit_price" + } + } + ], + "filename": "query.sql", + "insert_into_table": { + "name": "order_items" + } + }, + { + "text": "SELECT customer_id FROM customers ORDER BY customer_id LIMIT ?", + "name": "GetCustomerIds", + "cmd": ":many", + "columns": [ + { + "name": "customer_id", + "notNull": true, + "length": -1, + "table": { + "name": "customers" + }, + "type": { + "name": "INTEGER" + }, + "originalName": "customer_id" + } + ], + "parameters": [ + { + "number": 1, + "column": { + "name": "limit", + "notNull": true, + "length": -1, + "type": { + "name": "integer" + } + } + } + ], + "filename": "query.sql" + }, + { + "text": "SELECT product_id FROM products ORDER BY product_id LIMIT ?", + "name": "GetProductIds", + "cmd": ":many", + "columns": [ + { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "name": "products" + }, + "type": { + "name": "INTEGER" + }, + "originalName": "product_id" + } + ], + "parameters": [ + { + "number": 1, + "column": { + "name": "limit", + "notNull": true, + "length": -1, + "type": { + "name": "integer" + } + } + } + ], + "filename": "query.sql" + }, + { + "text": "SELECT order_id FROM orders ORDER BY order_id LIMIT ?", + "name": "GetOrderIds", + "cmd": ":many", + "columns": [ + { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "name": "orders" + }, + "type": { + "name": "INTEGER" + }, + "originalName": "order_id" + } + ], + "parameters": [ + { + "number": 1, + "column": { + "name": "limit", + "notNull": true, + "length": -1, + "type": { + "name": "integer" + } + } + } + ], + "filename": "query.sql" + }, + { + "text": "SELECT COUNT(*) AS cnt FROM order_items", + "name": "GetOrderItemsCount", + "cmd": ":one", + "columns": [ + { + "name": "cnt", + "notNull": true, + "length": -1, + "isFuncCall": true, + "type": { + "name": "integer" + } + } + ], + "filename": "query.sql" + }, + { + "text": "SELECT order_id, total_amount FROM orders WHERE order_id IN (/*SLICE:order_ids*/?)", + "name": "GetOrderAmounts", + "cmd": ":many", + "columns": [ + { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "name": "orders" + }, + "type": { + "name": "INTEGER" + }, + "originalName": "order_id" + }, + { + "name": "total_amount", + "notNull": true, + "length": -1, + "table": { + "name": "orders" + }, + "type": { + "name": "REAL" + }, + "originalName": "total_amount" + } + ], + "parameters": [ + { + "number": 1, + "column": { + "name": "order_id", + "notNull": true, + "length": -1, + "table": { + "name": "orders" + }, + "type": { + "name": "INTEGER" + }, + "originalName": "order_id" + } + } + ], + "filename": "query.sql" + }, + { + "text": "SELECT product_id, unit_price FROM products WHERE product_id IN (/*SLICE:product_ids*/?)", + "name": "GetProductPrices", + "cmd": ":many", + "columns": [ + { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "name": "products" + }, + "type": { + "name": "INTEGER" + }, + "originalName": "product_id" + }, + { + "name": "unit_price", + "notNull": true, + "length": -1, + "table": { + "name": "products" + }, + "type": { + "name": "REAL" + }, + "originalName": "unit_price" + } + ], + "parameters": [ + { + "number": 1, + "column": { + "name": "product_id", + "notNull": true, + "length": -1, + "table": { + "name": "products" + }, + "type": { + "name": "INTEGER" + }, + "originalName": "product_id" + } + } + ], + "filename": "query.sql" + } + ], + "sqlc_version": "v1.30.0", + "plugin_options": "eyJvdmVycmlkZURyaXZlclZlcnNpb24iOiIiLCJnZW5lcmF0ZUNzcHJvaiI6dHJ1ZSwidGFyZ2V0RnJhbWV3b3JrIjoibmV0OC4wIiwibmFtZXNwYWNlTmFtZSI6IlNxbGl0ZVNxbGNJbXBsIiwidXNlRGFwcGVyIjpmYWxzZSwib3ZlcnJpZGVEYXBwZXJWZXJzaW9uIjoiIiwib3ZlcnJpZGVzIjpudWxsLCJkZWJ1Z1JlcXVlc3QiOmZhbHNlLCJ1c2VDZW50cmFsUGFja2FnZU1hbmFnZW1lbnQiOmZhbHNlLCJ3aXRoQXN5bmNTdWZmaXgiOnRydWV9" +} \ No newline at end of file diff --git a/benchmark/SqliteSqlcImpl/request.message b/benchmark/SqliteSqlcImpl/request.message new file mode 100644 index 00000000..99632e08 --- /dev/null +++ b/benchmark/SqliteSqlcImpl/request.message @@ -0,0 +1,137 @@ + +Ö +2sqlite+examples/config/sqlite/benchmark/schema.sql"*examples/config/sqlite/benchmark/query.sqlbp +benchmark/SqliteSqlcImplcsharp6{"debugRequest":true,"namespaceName":"SqliteSqlcImpl"}* +./dist/LocalRunner• main"Œ mainŸ +  customers2 + customer_id0ÿÿÿÿÿÿÿÿÿR  customersb INTEGER( +name0ÿÿÿÿÿÿÿÿÿR  customersbTEXT) +email0ÿÿÿÿÿÿÿÿÿR  customersbTEXT) +phone0ÿÿÿÿÿÿÿÿÿR  customersbTEXT) +address0ÿÿÿÿÿÿÿÿÿR  customersbTEXT1 + registered_at0ÿÿÿÿÿÿÿÿÿR  customersbTEXTÔ + +products0 + +product_id0ÿÿÿÿÿÿÿÿÿR +productsb INTEGER' +name0ÿÿÿÿÿÿÿÿÿR +productsbTEXT+ +category0ÿÿÿÿÿÿÿÿÿR +productsbTEXT- + +unit_price0ÿÿÿÿÿÿÿÿÿR +productsbREAL4 +stock_quantity0ÿÿÿÿÿÿÿÿÿR +productsb INTEGER, + description0ÿÿÿÿÿÿÿÿÿR +productsbTEXT+ +added_at0ÿÿÿÿÿÿÿÿÿR +productsbTEXTó +orders, +order_id0ÿÿÿÿÿÿÿÿÿRordersb INTEGER/ + customer_id0ÿÿÿÿÿÿÿÿÿRordersb INTEGER+ + +ordered_at0ÿÿÿÿÿÿÿÿÿRordersbTEXT, + order_state0ÿÿÿÿÿÿÿÿÿRordersbTEXT- + total_amount0ÿÿÿÿÿÿÿÿÿRordersbREAL” +  order_items6 + order_item_id0ÿÿÿÿÿÿÿÿÿR  order_itemsb INTEGER1 +order_id0ÿÿÿÿÿÿÿÿÿR  order_itemsb INTEGER3 + +product_id0ÿÿÿÿÿÿÿÿÿR  order_itemsb INTEGER1 +quantity0ÿÿÿÿÿÿÿÿÿR  order_itemsb INTEGER0 + +unit_price0ÿÿÿÿÿÿÿÿÿR  order_itemsbREALç +ÍSELECT + o.order_id, ordered_at, order_state, total_amount, order_item_id, i.quantity, i.unit_price, + p.product_id, p.name as product_name, p.category as product_category +FROM orders o +JOIN order_items i +USING (order_id) +JOIN products p +USING (product_id) +WHERE o.customer_id = ?1 +ORDER BY o.ordered_at DESC +LIMIT ?3 OFFSET ?2GetCustomerOrders:many"6 +order_id0ÿÿÿÿÿÿÿÿÿRordersb INTEGERzorder_id"7 + +ordered_at0ÿÿÿÿÿÿÿÿÿRordersbTEXTz +ordered_at"9 + order_state0ÿÿÿÿÿÿÿÿÿRordersbTEXTz order_state"; + total_amount0ÿÿÿÿÿÿÿÿÿRordersbREALz total_amount"E + order_item_id0ÿÿÿÿÿÿÿÿÿR  order_itemsb INTEGERz order_item_id"; +quantity0ÿÿÿÿÿÿÿÿÿR  order_itemsb INTEGERzquantity"< + +unit_price0ÿÿÿÿÿÿÿÿÿR  order_itemsbREALz +unit_price"< + +product_id0ÿÿÿÿÿÿÿÿÿR +productsb INTEGERz +product_id"5 + product_name0ÿÿÿÿÿÿÿÿÿR +productsbTEXTzname"= +product_category0ÿÿÿÿÿÿÿÿÿR +productsbTEXTzcategory*B> + customer_id0ÿÿÿÿÿÿÿÿÿ8Rordersb INTEGERz customer_id*&" +offset0ÿÿÿÿÿÿÿÿÿ8b integer*%! +limit0ÿÿÿÿÿÿÿÿÿ8b integer: query.sqlÈ +YINSERT INTO customers (name, email, phone, address, registered_at) VALUES (?, ?, ?, ?, ?) AddCustomers :copyfrom*84 +name0ÿÿÿÿÿÿÿÿÿRmain customersbTEXTzname*:6 +email0ÿÿÿÿÿÿÿÿÿRmain customersbTEXTzemail*:6 +phone0ÿÿÿÿÿÿÿÿÿRmain customersbTEXTzphone*<8 +address0ÿÿÿÿÿÿÿÿÿRmain customersbTEXTzaddress*JF + registered_at0ÿÿÿÿÿÿÿÿÿRmain customersbTEXTz registered_at: query.sqlB  customersê +eINSERT INTO products (name, category, unit_price, stock_quantity, description) VALUES (?, ?, ?, ?, ?) AddProducts :copyfrom*73 +name0ÿÿÿÿÿÿÿÿÿRmainproductsbTEXTzname*?; +category0ÿÿÿÿÿÿÿÿÿRmainproductsbTEXTzcategory*C? + +unit_price0ÿÿÿÿÿÿÿÿÿRmainproductsbREALz +unit_price*NJ +stock_quantity0ÿÿÿÿÿÿÿÿÿRmainproductsb INTEGERzstock_quantity*C? + description0ÿÿÿÿÿÿÿÿÿRmainproductsbTEXTz description: query.sqlB +productsÍ +LINSERT INTO orders (customer_id, order_state, total_amount) VALUES (?, ?, ?) AddOrders :copyfrom*FB + customer_id0ÿÿÿÿÿÿÿÿÿRmainordersb INTEGERz customer_id*C? + order_state0ÿÿÿÿÿÿÿÿÿRmainordersbTEXTz order_state*EA + total_amount0ÿÿÿÿÿÿÿÿÿRmainordersbREALz total_amount: query.sqlBorders¯ +XINSERT INTO order_items (order_id, product_id, quantity, unit_price) VALUES (?, ?, ?, ?) AddOrderItems :copyfrom*EA +order_id0ÿÿÿÿÿÿÿÿÿRmain order_itemsb INTEGERzorder_id*IE + +product_id0ÿÿÿÿÿÿÿÿÿRmain order_itemsb INTEGERz +product_id*EA +quantity0ÿÿÿÿÿÿÿÿÿRmain order_itemsb INTEGERzquantity*FB + +unit_price0ÿÿÿÿÿÿÿÿÿRmain order_itemsbREALz +unit_price: query.sqlB  order_itemsÈ +>SELECT customer_id FROM customers ORDER BY customer_id LIMIT ?GetCustomerIds:many"? + customer_id0ÿÿÿÿÿÿÿÿÿR  customersb INTEGERz customer_id*# +limit0ÿÿÿÿÿÿÿÿÿb integer: query.sqlÁ +;SELECT product_id FROM products ORDER BY product_id LIMIT ? GetProductIds:many"< + +product_id0ÿÿÿÿÿÿÿÿÿR +productsb INTEGERz +product_id*# +limit0ÿÿÿÿÿÿÿÿÿb integer: query.sql³ +5SELECT order_id FROM orders ORDER BY order_id LIMIT ? GetOrderIds:many"6 +order_id0ÿÿÿÿÿÿÿÿÿRordersb INTEGERzorder_id*# +limit0ÿÿÿÿÿÿÿÿÿb integer: query.sqlo +'SELECT COUNT(*) AS cnt FROM order_itemsGetOrderItemsCount:one" +cnt0ÿÿÿÿÿÿÿÿÿ@b integer: query.sql¨ +RSELECT order_id, total_amount FROM orders WHERE order_id IN (/*SLICE:order_ids*/?)GetOrderAmounts:many"6 +order_id0ÿÿÿÿÿÿÿÿÿRordersb INTEGERzorder_id"; + total_amount0ÿÿÿÿÿÿÿÿÿRordersbREALz total_amount*:6 +order_id0ÿÿÿÿÿÿÿÿÿRordersb INTEGERzorder_id: query.sql¹ +XSELECT product_id, unit_price FROM products WHERE product_id IN (/*SLICE:product_ids*/?)GetProductPrices:many"< + +product_id0ÿÿÿÿÿÿÿÿÿR +productsb INTEGERz +product_id"9 + +unit_price0ÿÿÿÿÿÿÿÿÿR +productsbREALz +unit_price*@< + +product_id0ÿÿÿÿÿÿÿÿÿR +productsb INTEGERz +product_id: query.sql"v1.30.0*ü{"overrideDriverVersion":"","generateCsproj":true,"targetFramework":"net8.0","namespaceName":"SqliteSqlcImpl","useDapper":false,"overrideDapperVersion":"","overrides":null,"debugRequest":false,"useCentralPackageManagement":false,"withAsyncSuffix":true} \ No newline at end of file diff --git a/benchmark/scripts/run_single_benchmark.sh b/benchmark/scripts/run_single_benchmark.sh new file mode 100755 index 00000000..e8cc6ef9 --- /dev/null +++ b/benchmark/scripts/run_single_benchmark.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +set -ex + +database_to_benchmark=$1 +type_to_benchmark=$2 + +function dotnet_run() { + dotnet run -c Release --project ./benchmark/BenchmarkRunner/BenchmarkRunner.csproj -- \ + --database $database_to_benchmark \ + --type $type_to_benchmark +} + +function docker_compose_up() { + service_name=$1 + docker-compose up --build --detach --force-recreate --remove-orphans --wait $service_name +} + +# Adjust the SQLite connection string to use absolute path +function adjust_sqlite_connection_string() { + if [[ "$OSTYPE" == "darwin"* ]]; then + sed -i '' "s|Data Source=\([^;]*\.db\);|Data Source=$(pwd)/\1;|" .env + else + sed -i "s|Data Source=\([^;]*\.db\);|Data Source=$(pwd)/\1;|" .env + fi +} + +function delete_current_sqlite_db() { + rm -f $(pwd)/.sqlite/*.db +} + +function docker_destroy() { + docker-compose down --volumes +} + +function copy_original_env() { + cp .env.bak .env +} + +# Github Actions handles the Docker Compose setup, this is only needed when running locally +if [[ -z "$GITHUB_ACTIONS" ]]; then + if [ "$database_to_benchmark" = "mysql" ]; then + trap docker_destroy EXIT + docker_compose_up mysqldb + elif [ "$database_to_benchmark" = "postgresql" ]; then + trap docker_destroy EXIT + docker_compose_up postgresdb + fi +fi + +if [ "$database_to_benchmark" = "sqlite" ]; then + cp .env .env.bak + trap copy_original_env EXIT + adjust_sqlite_connection_string + delete_current_sqlite_db +fi + +dotnet_run \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 3447f80e..31de993d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,9 @@ services: mysqldb: container_name: mysqldb - build: examples/config/mysql + build: + context: . + dockerfile: mysql.Dockerfile restart: always ports: - "3306:3306" @@ -18,7 +20,9 @@ services: postgresdb: container_name: postgresdb - build: examples/config/postgresql + build: + context: . + dockerfile: postgres.Dockerfile restart: always ports: - "5432:5432" @@ -29,4 +33,4 @@ services: healthcheck: test: "pg_isready -d tests" timeout: 20s - retries: 10 \ No newline at end of file + retries: 10 diff --git a/docs/07_Benchmark.md b/docs/07_Benchmark.md new file mode 100644 index 00000000..98f3f865 --- /dev/null +++ b/docs/07_Benchmark.md @@ -0,0 +1,24 @@ +# Benchmark Results + +## Read Benchmarks +`L=Query Limit, C=Concurrency, Q=Total Queries To Submit` + +[PostgreSQL - Reads](https://github.com/DaredevilOSS/sqlc-gen-csharp/blob/main/benchmark/BenchmarkDotNet.Artifacts/postgresql/results/BenchmarkRunner.Benchmarks.PostgresqlReadBenchmark-report-github.md) +
+ +[MySQL - Reads](https://github.com/DaredevilOSS/sqlc-gen-csharp/blob/main/benchmark/BenchmarkDotNet.Artifacts/mysql/results/BenchmarkRunner.Benchmarks.MysqlReadBenchmark-report-github.md) +
+ +[SQLite - Reads](https://github.com/DaredevilOSS/sqlc-gen-csharp/blob/main/benchmark/BenchmarkDotNet.Artifacts/sqlite/results/BenchmarkRunner.Benchmarks.SqliteReadBenchmark-report-github.md) +
+ +## Write Benchmarks +`R=Total Records to Load, B=Batch Size` + +[PostgreSQL - Writes](https://github.com/DaredevilOSS/sqlc-gen-csharp/blob/main/benchmark/BenchmarkDotNet.Artifacts/postgresql/results/BenchmarkRunner.Benchmarks.PostgresqlWriteBenchmark-report-github.md) +
+ +[MySQL - Writes](https://github.com/DaredevilOSS/sqlc-gen-csharp/blob/main/benchmark/BenchmarkDotNet.Artifacts/mysql/results/BenchmarkRunner.Benchmarks.MysqlWriteBenchmark-report-github.md) +
+ +[SQLite - Writes](https://github.com/DaredevilOSS/sqlc-gen-csharp/blob/main/benchmark/BenchmarkDotNet.Artifacts/sqlite/results/BenchmarkRunner.Benchmarks.SqliteWriteBenchmark-report-github.md) diff --git a/docs/07_Contributing.md b/docs/08_Contributing.md similarity index 100% rename from docs/07_Contributing.md rename to docs/08_Contributing.md diff --git a/docs/08_Examples.md b/docs/09_Examples.md similarity index 100% rename from docs/08_Examples.md rename to docs/09_Examples.md diff --git a/end2end/EndToEndCommon/EndToEndCommon.cs b/end2end/EndToEndCommon/EndToEndCommon.cs index d2866625..cb3e7520 100644 --- a/end2end/EndToEndCommon/EndToEndCommon.cs +++ b/end2end/EndToEndCommon/EndToEndCommon.cs @@ -9,67 +9,78 @@ namespace EndToEndTests public static class EndToEndCommon { private const string EnvFile = ".env"; - private static readonly string[] SchemaFiles = new string[] { - "authors.sqlite.schema.sql", - "types.sqlite.schema.sql" - }; - public const string PostgresConnectionStringEnv = "POSTGRES_CONNECTION_STRING"; public const string MySqlConnectionStringEnv = "MYSQL_CONNECTION_STRING"; public const string SqliteConnectionStringEnv = "SQLITE_CONNECTION_STRING"; + public const string SqliteBenchmarkConnectionStringEnv = "SQLITE_BENCHMARK_CONNECTION_STRING"; - public static void SetUp() + public static void SetupTestsSqliteDb() => SetupSqliteDb( + SqliteConnectionStringEnv, + new string[] { "authors.sqlite.schema.sql", "types.sqlite.schema.sql" } + ); + public static void SetupBenchmarkSqliteDb() => SetupSqliteDb( + SqliteBenchmarkConnectionStringEnv, + new string[] { "sqlite.schema.sql" } + ); + public static void SetupSqliteDb(string connectionStringEnv, string[] schemaFiles) { - if (File.Exists(EnvFile)) - DotEnv.Load(options: new DotEnvOptions(envFilePaths: new[] { EnvFile })); - RemoveExistingSqliteDb(); - InitSqliteDb(); - } + if (!File.Exists(EnvFile)) + throw new FileNotFoundException($"{EnvFile} not found"); - public static void TearDown() - { - RemoveExistingSqliteDb(); + DotEnv.Load(options: new DotEnvOptions(envFilePaths: new[] { EnvFile })); + RemoveExistingSqliteDb(connectionStringEnv); + InitSqliteDb(connectionStringEnv, schemaFiles); } - - private static void RemoveExistingSqliteDb() + public static void RemoveExistingSqliteDb(string connectionStringEnv) { - var connectionString = Environment.GetEnvironmentVariable(SqliteConnectionStringEnv); - if (connectionString == null) return; + var connectionString = Environment.GetEnvironmentVariable(connectionStringEnv); + if (string.IsNullOrWhiteSpace(connectionString)) + throw new InvalidOperationException($"{connectionStringEnv} environment variable is not set"); var dbFilename = SqliteFilenameRegex.Match(connectionString).Groups[1].Value; - Console.WriteLine($"Removing sqlite db from {dbFilename}"); if (!File.Exists(dbFilename)) return; - try - { - File.Delete(dbFilename); - } - catch (Exception) - { - // ignored - } + Console.WriteLine($"Removing sqlite db from {dbFilename}"); + File.Delete(dbFilename); } - private static void InitSqliteDb() + private static void InitSqliteDb(string connectionStringEnv, string[] schemaFiles) { - var connectionString = Environment.GetEnvironmentVariable(EndToEndCommon.SqliteConnectionStringEnv); - using (var connection = new SqliteConnection(connectionString)) + var connectionString = Environment.GetEnvironmentVariable(connectionStringEnv); + if (string.IsNullOrWhiteSpace(connectionString)) + throw new InvalidOperationException($"{connectionStringEnv} environment variable is not set"); + + connectionString = connectionString.Replace("Mode=ReadWrite", "Mode=ReadWriteCreate"); + try { - connection.Open(); - foreach (var schemaFile in SchemaFiles) + using (var connection = new SqliteConnection(connectionString)) { - if (!File.Exists(schemaFile)) - continue; - - var schemaSql = File.ReadAllText(schemaFile); - using (var command = connection.CreateCommand()) + connection.Open(); + foreach (var schemaFile in schemaFiles) { - command.CommandText = schemaSql; - command.ExecuteNonQuery(); + var schemaFileToUse = schemaFile; + if (!File.Exists(schemaFile)) + { + schemaFileToUse = Path.Combine(AppContext.BaseDirectory, schemaFile); + if (!File.Exists(schemaFileToUse)) + throw new FileNotFoundException($"Schema file {schemaFile} not found"); + } + + var schemaSql = File.ReadAllText(schemaFileToUse); + using (var command = connection.CreateCommand()) + { + command.CommandText = schemaSql; + command.ExecuteNonQuery(); + } } + Console.WriteLine($"Initialized sqlite db from {connectionString}"); } } + catch (Exception ex) + { + Console.WriteLine($"Error initializing sqlite db from {connectionString}: {ex.Message}"); + throw; + } } - private static readonly Regex SqliteFilenameRegex = new Regex(@"Data Source=([\w\.\/\-]+\.db);", RegexOptions.Compiled); } } \ No newline at end of file diff --git a/end2end/EndToEndTests/GlobalSetup.cs b/end2end/EndToEndTests/GlobalSetup.cs index 16d9683f..3defd87f 100644 --- a/end2end/EndToEndTests/GlobalSetup.cs +++ b/end2end/EndToEndTests/GlobalSetup.cs @@ -8,12 +8,12 @@ public class GlobalSetup [OneTimeSetUp] public void SetUp() { - EndToEndCommon.SetUp(); + EndToEndCommon.SetupTestsSqliteDb(); } [OneTimeTearDown] public void TearDown() { - EndToEndCommon.TearDown(); + EndToEndCommon.RemoveExistingSqliteDb(EndToEndCommon.SqliteConnectionStringEnv); } } \ No newline at end of file diff --git a/end2end/EndToEndTestsLegacy/GlobalSetup.cs b/end2end/EndToEndTestsLegacy/GlobalSetup.cs index 28a165d3..597fa7dd 100644 --- a/end2end/EndToEndTestsLegacy/GlobalSetup.cs +++ b/end2end/EndToEndTestsLegacy/GlobalSetup.cs @@ -8,13 +8,13 @@ public class GlobalSetup [OneTimeSetUp] public void SetUp() { - EndToEndCommon.SetUp(); + EndToEndCommon.SetupTestsSqliteDb(); } [OneTimeTearDown] public void TearDown() { - EndToEndCommon.TearDown(); + EndToEndCommon.RemoveExistingSqliteDb(EndToEndCommon.SqliteConnectionStringEnv); } } } \ No newline at end of file diff --git a/examples/MySqlConnectorDapperExample/Models.cs b/examples/MySqlConnectorDapperExample/Models.cs index 5b323bf6..38eb7564 100644 --- a/examples/MySqlConnectorDapperExample/Models.cs +++ b/examples/MySqlConnectorDapperExample/Models.cs @@ -3,6 +3,7 @@ using NodaTime.Extensions; using System; using System.Collections.Generic; +using System.Data.Common; using System.Linq; using System.Text.Json; diff --git a/examples/MySqlConnectorDapperExample/QuerySql.cs b/examples/MySqlConnectorDapperExample/QuerySql.cs index b32a1418..0b779d3a 100644 --- a/examples/MySqlConnectorDapperExample/QuerySql.cs +++ b/examples/MySqlConnectorDapperExample/QuerySql.cs @@ -13,24 +13,36 @@ using NodaTime.Extensions; using System; using System.Collections.Generic; +using System.Data; +using System.Data.Common; using System.Globalization; using System.IO; using System.Text; using System.Text.Json; +using System.Threading; using System.Threading.Tasks; namespace MySqlConnectorDapperExampleGen; -public class QuerySql +public class QuerySql : IDisposable { public QuerySql() { Utils.ConfigureSqlMapper(); - Dapper.DefaultTypeMap.MatchNamesWithUnderscores = true; + DefaultTypeMap.MatchNamesWithUnderscores = true; } public QuerySql(string connectionString) : this() { this.ConnectionString = connectionString; + _dataSource = new Lazy(() => + { + var builder = new MySqlConnectionStringBuilder(connectionString!); + builder.ConnectionReset = true; + // Pre-warm connection pool with minimum connections + if (builder.MinimumPoolSize == 0) + builder.MinimumPoolSize = 1; + return new MySqlDataSourceBuilder(builder.ConnectionString).Build(); + }, LazyThreadSafetyMode.ExecutionAndPublication); } private QuerySql(MySqlTransaction transaction) : this() @@ -46,6 +58,21 @@ public static QuerySql WithTransaction(MySqlTransaction transaction) private MySqlTransaction? Transaction { get; } private string? ConnectionString { get; } + private readonly Lazy? _dataSource; + private MySqlDataSource GetDataSource() + { + if (_dataSource == null) + throw new InvalidOperationException("ConnectionString is required when not using a transaction"); + return _dataSource.Value; + } + + public void Dispose() + { + GC.SuppressFinalize(this); + if (_dataSource?.IsValueCreated == true) + _dataSource.Value.Dispose(); + } + private const string GetAuthorSql = "SELECT id, name, bio FROM authors WHERE name = @name LIMIT 1"; public class GetAuthorRow { @@ -63,14 +90,14 @@ public class GetAuthorArgs queryParams.Add("name", args.Name); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetAuthorSql, queryParams); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetAuthorSql, queryParams, transaction: this.Transaction); } @@ -97,14 +124,14 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) queryParams.Add("offset", args.Offset); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryAsync(ListAuthorsSql, queryParams); return result.AsList(); } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(ListAuthorsSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -124,12 +151,14 @@ public async Task CreateAuthorAsync(CreateAuthorArgs args) queryParams.Add("bio", args.Bio); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(CreateAuthorSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(CreateAuthorSql, queryParams, transaction: this.Transaction); } @@ -147,11 +176,13 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) queryParams.Add("bio", args.Bio); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { return await connection.QuerySingleAsync(CreateAuthorReturnIdSql, queryParams); + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QuerySingleAsync(CreateAuthorReturnIdSql, queryParams, transaction: this.Transaction); } @@ -173,14 +204,14 @@ public class GetAuthorByIdArgs queryParams.Add("id", args.Id); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetAuthorByIdSql, queryParams); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetAuthorByIdSql, queryParams, transaction: this.Transaction); } @@ -203,14 +234,14 @@ public async Task> GetAuthorByNamePatternAsync(G queryParams.Add("name_pattern", args.NamePattern); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryAsync(GetAuthorByNamePatternSql, queryParams); return result.AsList(); } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(GetAuthorByNamePatternSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -227,12 +258,14 @@ public async Task DeleteAuthorAsync(DeleteAuthorArgs args) queryParams.Add("name", args.Name); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(DeleteAuthorSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(DeleteAuthorSql, queryParams, transaction: this.Transaction); } @@ -242,12 +275,14 @@ public async Task DeleteAllAuthorsAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(DeleteAllAuthorsSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(DeleteAllAuthorsSql, transaction: this.Transaction); } @@ -265,11 +300,13 @@ public async Task UpdateAuthorsAsync(UpdateAuthorsArgs args) queryParams.Add("bio", args.Bio); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { return await connection.ExecuteAsync(UpdateAuthorsSql, queryParams); + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.ExecuteAsync(UpdateAuthorsSql, queryParams, transaction: this.Transaction); } @@ -294,14 +331,14 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds queryParams.Add($"@idsArg{i}", args.Ids[i]); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryAsync(transformedSql, queryParams); return result.AsList(); } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(transformedSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -330,14 +367,14 @@ public async Task> GetAuthorsByIdsAndNamesAsync queryParams.Add($"@namesArg{i}", args.Names[i]); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryAsync(transformedSql, queryParams); return result.AsList(); } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(transformedSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -355,11 +392,13 @@ public async Task CreateBookAsync(CreateBookArgs args) queryParams.Add("author_id", args.AuthorId); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { return await connection.QuerySingleAsync(CreateBookSql, queryParams); + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QuerySingleAsync(CreateBookSql, queryParams, transaction: this.Transaction); } @@ -376,11 +415,11 @@ public async Task> ListAllAuthorsBooksAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(ListAllAuthorsBooksSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = ListAllAuthorsBooksSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -392,7 +431,7 @@ public async Task> ListAllAuthorsBooksAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -420,11 +459,11 @@ public async Task> GetDuplicateAuthorsAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetDuplicateAuthorsSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetDuplicateAuthorsSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -436,7 +475,7 @@ public async Task> GetDuplicateAuthorsAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -470,11 +509,11 @@ public async Task> GetAuthorsByBookNameAsync(GetAu { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetAuthorsByBookNameSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorsByBookNameSql; command.Parameters.AddWithValue("@name", args.Name); using (var reader = await command.ExecuteReaderAsync()) { @@ -487,7 +526,7 @@ public async Task> GetAuthorsByBookNameAsync(GetAu } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -521,12 +560,14 @@ public async Task CreateExtendedBioAsync(CreateExtendedBioArgs args) queryParams.Add("author_type", args.AuthorType != null ? string.Join(",", args.AuthorType) : null); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(CreateExtendedBioSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(CreateExtendedBioSql, queryParams, transaction: this.Transaction); } @@ -549,14 +590,14 @@ public class GetFirstExtendedBioByTypeArgs queryParams.Add("bio_type", args.BioType); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetFirstExtendedBioByTypeSql, queryParams); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetFirstExtendedBioByTypeSql, queryParams, transaction: this.Transaction); } @@ -566,12 +607,14 @@ public async Task TruncateExtendedBiosAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncateExtendedBiosSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncateExtendedBiosSql, transaction: this.Transaction); } @@ -634,12 +677,14 @@ public async Task InsertMysqlNumericTypesAsync(InsertMysqlNumericTypesArgs args) queryParams.Add("c_double_precision", args.CDoublePrecision); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(InsertMysqlNumericTypesSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(InsertMysqlNumericTypesSql, queryParams, transaction: this.Transaction); } @@ -693,9 +738,8 @@ public async Task InsertMysqlNumericTypesBatchAsync(List { "c_bool", "c_boolean", "c_tinyint", "c_smallint", "c_mediumint", "c_int", "c_integer", "c_bigint", "c_float", "c_numeric", "c_decimal", "c_dec", "c_fixed", "c_double", "c_double_precision" }); await loader.LoadAsync(); - await connection.CloseAsync(); } } @@ -736,14 +779,14 @@ public class GetMysqlNumericTypesRow { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetMysqlNumericTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetMysqlNumericTypesSql, transaction: this.Transaction); } @@ -806,14 +849,14 @@ public class GetMysqlNumericTypesCntRow { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetMysqlNumericTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetMysqlNumericTypesCntSql, transaction: this.Transaction); } @@ -823,12 +866,14 @@ public async Task TruncateMysqlNumericTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncateMysqlNumericTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncateMysqlNumericTypesSql, transaction: this.Transaction); } @@ -882,12 +927,14 @@ public async Task InsertMysqlStringTypesAsync(InsertMysqlStringTypesArgs args) queryParams.Add("c_set", args.CSet != null ? string.Join(",", args.CSet) : null); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(InsertMysqlStringTypesSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(InsertMysqlStringTypesSql, queryParams, transaction: this.Transaction); } @@ -936,9 +983,8 @@ public async Task InsertMysqlStringTypesBatchAsync(List { "c_char", "c_nchar", "c_national_char", "c_varchar", "c_tinytext", "c_mediumtext", "c_text", "c_longtext", "c_json", "c_json_string_override", "c_enum", "c_set" }); await loader.LoadAsync(); - await connection.CloseAsync(); } } @@ -976,14 +1021,14 @@ public class GetMysqlStringTypesRow { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetMysqlStringTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetMysqlStringTypesSql, transaction: this.Transaction); } @@ -1037,14 +1082,14 @@ public class GetMysqlStringTypesCntRow { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetMysqlStringTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetMysqlStringTypesCntSql, transaction: this.Transaction); } @@ -1054,12 +1099,14 @@ public async Task TruncateMysqlStringTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncateMysqlStringTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncateMysqlStringTypesSql, transaction: this.Transaction); } @@ -1095,12 +1142,14 @@ public async Task InsertMysqlDatetimeTypesAsync(InsertMysqlDatetimeTypesArgs arg queryParams.Add("c_timestamp_noda_instant_override", args.CTimestampNodaInstantOverride is null ? null : (DateTime? )DateTime.SpecifyKind(args.CTimestampNodaInstantOverride.Value.ToDateTimeUtc(), DateTimeKind.Unspecified)); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(InsertMysqlDatetimeTypesSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(InsertMysqlDatetimeTypesSql, queryParams, transaction: this.Transaction); } @@ -1140,9 +1189,8 @@ public async Task InsertMysqlDatetimeTypesBatchAsync(List { "c_year", "c_date", "c_datetime", "c_timestamp", "c_time" }); await loader.LoadAsync(); - await connection.CloseAsync(); } } @@ -1174,14 +1221,14 @@ public class GetMysqlDatetimeTypesRow { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetMysqlDatetimeTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetMysqlDatetimeTypesSql, transaction: this.Transaction); } @@ -1214,14 +1261,14 @@ public class GetMysqlDatetimeTypesCntRow { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetMysqlDatetimeTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetMysqlDatetimeTypesCntSql, transaction: this.Transaction); } @@ -1231,12 +1278,14 @@ public async Task TruncateMysqlDatetimeTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncateMysqlDatetimeTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncateMysqlDatetimeTypesSql, transaction: this.Transaction); } @@ -1275,12 +1324,14 @@ public async Task InsertMysqlBinaryTypesAsync(InsertMysqlBinaryTypesArgs args) queryParams.Add("c_longblob", args.CLongblob); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(InsertMysqlBinaryTypesSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(InsertMysqlBinaryTypesSql, queryParams, transaction: this.Transaction); } @@ -1323,9 +1374,8 @@ public async Task InsertMysqlBinaryTypesBatchAsync(List { "c_bit", "c_binary", "c_varbinary", "c_tinyblob", "c_blob", "c_mediumblob", "c_longblob" }); await loader.LoadAsync(); - await connection.CloseAsync(); } } @@ -1358,14 +1407,14 @@ public class GetMysqlBinaryTypesRow { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetMysqlBinaryTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetMysqlBinaryTypesSql, transaction: this.Transaction); } @@ -1404,14 +1453,14 @@ public class GetMysqlBinaryTypesCntRow { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetMysqlBinaryTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetMysqlBinaryTypesCntSql, transaction: this.Transaction); } @@ -1421,12 +1470,14 @@ public async Task TruncateMysqlBinaryTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncateMysqlBinaryTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncateMysqlBinaryTypesSql, transaction: this.Transaction); } @@ -1449,14 +1500,14 @@ public class GetMysqlFunctionsRow { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetMysqlFunctionsSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetMysqlFunctionsSql, transaction: this.Transaction); } diff --git a/examples/MySqlConnectorDapperExample/Utils.cs b/examples/MySqlConnectorDapperExample/Utils.cs index a5913f0d..af91c19e 100644 --- a/examples/MySqlConnectorDapperExample/Utils.cs +++ b/examples/MySqlConnectorDapperExample/Utils.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.Data; +using System.Data.Common; using System.Linq; using System.Text.Json; diff --git a/examples/MySqlConnectorDapperLegacyExample/Models.cs b/examples/MySqlConnectorDapperLegacyExample/Models.cs index 7ef2a24a..8ed07fb4 100644 --- a/examples/MySqlConnectorDapperLegacyExample/Models.cs +++ b/examples/MySqlConnectorDapperLegacyExample/Models.cs @@ -5,6 +5,7 @@ namespace MySqlConnectorDapperLegacyExampleGen using NodaTime.Extensions; using System; using System.Collections.Generic; + using System.Data.Common; using System.Linq; using System.Text.Json; diff --git a/examples/MySqlConnectorDapperLegacyExample/QuerySql.cs b/examples/MySqlConnectorDapperLegacyExample/QuerySql.cs index 13f24366..80442748 100644 --- a/examples/MySqlConnectorDapperLegacyExample/QuerySql.cs +++ b/examples/MySqlConnectorDapperLegacyExample/QuerySql.cs @@ -15,23 +15,35 @@ namespace MySqlConnectorDapperLegacyExampleGen using NodaTime.Extensions; using System; using System.Collections.Generic; + using System.Data; + using System.Data.Common; using System.Globalization; using System.IO; using System.Text; using System.Text.Json; + using System.Threading; using System.Threading.Tasks; - public class QuerySql + public class QuerySql : IDisposable { public QuerySql() { Utils.ConfigureSqlMapper(); - Dapper.DefaultTypeMap.MatchNamesWithUnderscores = true; + DefaultTypeMap.MatchNamesWithUnderscores = true; } public QuerySql(string connectionString) : this() { this.ConnectionString = connectionString; + _dataSource = new Lazy(() => + { + var builder = new MySqlConnectionStringBuilder(connectionString); + builder.ConnectionReset = true; + // Pre-warm connection pool with minimum connections + if (builder.MinimumPoolSize == 0) + builder.MinimumPoolSize = 1; + return new MySqlDataSourceBuilder(builder.ConnectionString).Build(); + }, LazyThreadSafetyMode.ExecutionAndPublication); } private QuerySql(MySqlTransaction transaction) : this() @@ -47,6 +59,21 @@ public static QuerySql WithTransaction(MySqlTransaction transaction) private MySqlTransaction Transaction { get; } private string ConnectionString { get; } + private readonly Lazy _dataSource; + private MySqlDataSource GetDataSource() + { + if (_dataSource == null) + throw new InvalidOperationException("ConnectionString is required when not using a transaction"); + return _dataSource.Value; + } + + public void Dispose() + { + GC.SuppressFinalize(this); + if (_dataSource?.IsValueCreated == true) + _dataSource.Value.Dispose(); + } + private const string GetAuthorSql = "SELECT id, name, bio FROM authors WHERE name = @name LIMIT 1"; public class GetAuthorRow { @@ -64,14 +91,14 @@ public async Task GetAuthorAsync(GetAuthorArgs args) queryParams.Add("name", args.Name); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetAuthorSql, queryParams); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetAuthorSql, queryParams, transaction: this.Transaction); } @@ -98,14 +125,14 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) queryParams.Add("offset", args.Offset); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryAsync(ListAuthorsSql, queryParams); return result.AsList(); } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(ListAuthorsSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -125,12 +152,14 @@ public async Task CreateAuthorAsync(CreateAuthorArgs args) queryParams.Add("bio", args.Bio); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(CreateAuthorSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(CreateAuthorSql, queryParams, transaction: this.Transaction); } @@ -148,11 +177,13 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) queryParams.Add("bio", args.Bio); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { return await connection.QuerySingleAsync(CreateAuthorReturnIdSql, queryParams); + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QuerySingleAsync(CreateAuthorReturnIdSql, queryParams, transaction: this.Transaction); } @@ -174,14 +205,14 @@ public async Task GetAuthorByIdAsync(GetAuthorByIdArgs args) queryParams.Add("id", args.Id); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetAuthorByIdSql, queryParams); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetAuthorByIdSql, queryParams, transaction: this.Transaction); } @@ -204,14 +235,14 @@ public async Task> GetAuthorByNamePatternAsync(G queryParams.Add("name_pattern", args.NamePattern); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryAsync(GetAuthorByNamePatternSql, queryParams); return result.AsList(); } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(GetAuthorByNamePatternSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -228,12 +259,14 @@ public async Task DeleteAuthorAsync(DeleteAuthorArgs args) queryParams.Add("name", args.Name); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(DeleteAuthorSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(DeleteAuthorSql, queryParams, transaction: this.Transaction); } @@ -243,12 +276,14 @@ public async Task DeleteAllAuthorsAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(DeleteAllAuthorsSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(DeleteAllAuthorsSql, transaction: this.Transaction); } @@ -266,11 +301,13 @@ public async Task UpdateAuthorsAsync(UpdateAuthorsArgs args) queryParams.Add("bio", args.Bio); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { return await connection.ExecuteAsync(UpdateAuthorsSql, queryParams); + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.ExecuteAsync(UpdateAuthorsSql, queryParams, transaction: this.Transaction); } @@ -295,14 +332,14 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds queryParams.Add($"@idsArg{i}", args.Ids[i]); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryAsync(transformedSql, queryParams); return result.AsList(); } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(transformedSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -331,14 +368,14 @@ public async Task> GetAuthorsByIdsAndNamesAsync queryParams.Add($"@namesArg{i}", args.Names[i]); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryAsync(transformedSql, queryParams); return result.AsList(); } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(transformedSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -356,11 +393,13 @@ public async Task CreateBookAsync(CreateBookArgs args) queryParams.Add("author_id", args.AuthorId); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { return await connection.QuerySingleAsync(CreateBookSql, queryParams); + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QuerySingleAsync(CreateBookSql, queryParams, transaction: this.Transaction); } @@ -377,11 +416,11 @@ public async Task> ListAllAuthorsBooksAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(ListAllAuthorsBooksSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = ListAllAuthorsBooksSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -393,7 +432,7 @@ public async Task> ListAllAuthorsBooksAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -421,11 +460,11 @@ public async Task> GetDuplicateAuthorsAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetDuplicateAuthorsSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetDuplicateAuthorsSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -437,7 +476,7 @@ public async Task> GetDuplicateAuthorsAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -471,11 +510,11 @@ public async Task> GetAuthorsByBookNameAsync(GetAu { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetAuthorsByBookNameSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorsByBookNameSql; command.Parameters.AddWithValue("@name", args.Name); using (var reader = await command.ExecuteReaderAsync()) { @@ -488,7 +527,7 @@ public async Task> GetAuthorsByBookNameAsync(GetAu } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -522,12 +561,14 @@ public async Task CreateExtendedBioAsync(CreateExtendedBioArgs args) queryParams.Add("author_type", args.AuthorType != null ? string.Join(",", args.AuthorType) : null); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(CreateExtendedBioSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(CreateExtendedBioSql, queryParams, transaction: this.Transaction); } @@ -550,14 +591,14 @@ public async Task GetFirstExtendedBioByTypeAsync(G queryParams.Add("bio_type", args.BioType); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetFirstExtendedBioByTypeSql, queryParams); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetFirstExtendedBioByTypeSql, queryParams, transaction: this.Transaction); } @@ -567,12 +608,14 @@ public async Task TruncateExtendedBiosAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncateExtendedBiosSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncateExtendedBiosSql, transaction: this.Transaction); } @@ -635,12 +678,14 @@ public async Task InsertMysqlNumericTypesAsync(InsertMysqlNumericTypesArgs args) queryParams.Add("c_double_precision", args.CDoublePrecision); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(InsertMysqlNumericTypesSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(InsertMysqlNumericTypesSql, queryParams, transaction: this.Transaction); } @@ -694,9 +739,8 @@ public async Task InsertMysqlNumericTypesBatchAsync(List { "c_bool", "c_boolean", "c_tinyint", "c_smallint", "c_mediumint", "c_int", "c_integer", "c_bigint", "c_float", "c_numeric", "c_decimal", "c_dec", "c_fixed", "c_double", "c_double_precision" }); await loader.LoadAsync(); - await connection.CloseAsync(); } } @@ -737,14 +780,14 @@ public async Task GetMysqlNumericTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetMysqlNumericTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetMysqlNumericTypesSql, transaction: this.Transaction); } @@ -807,14 +850,14 @@ public async Task GetMysqlNumericTypesCntAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetMysqlNumericTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetMysqlNumericTypesCntSql, transaction: this.Transaction); } @@ -824,12 +867,14 @@ public async Task TruncateMysqlNumericTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncateMysqlNumericTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncateMysqlNumericTypesSql, transaction: this.Transaction); } @@ -883,12 +928,14 @@ public async Task InsertMysqlStringTypesAsync(InsertMysqlStringTypesArgs args) queryParams.Add("c_set", args.CSet != null ? string.Join(",", args.CSet) : null); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(InsertMysqlStringTypesSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(InsertMysqlStringTypesSql, queryParams, transaction: this.Transaction); } @@ -936,9 +983,8 @@ public async Task InsertMysqlStringTypesBatchAsync(List { "c_char", "c_nchar", "c_national_char", "c_varchar", "c_tinytext", "c_mediumtext", "c_text", "c_longtext", "c_json", "c_json_string_override", "c_enum", "c_set" }); await loader.LoadAsync(); - await connection.CloseAsync(); } } @@ -976,14 +1021,14 @@ public async Task GetMysqlStringTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetMysqlStringTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetMysqlStringTypesSql, transaction: this.Transaction); } @@ -1037,14 +1082,14 @@ public async Task GetMysqlStringTypesCntAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetMysqlStringTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetMysqlStringTypesCntSql, transaction: this.Transaction); } @@ -1054,12 +1099,14 @@ public async Task TruncateMysqlStringTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncateMysqlStringTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncateMysqlStringTypesSql, transaction: this.Transaction); } @@ -1095,12 +1142,14 @@ public async Task InsertMysqlDatetimeTypesAsync(InsertMysqlDatetimeTypesArgs arg queryParams.Add("c_timestamp_noda_instant_override", args.CTimestampNodaInstantOverride is null ? null : (DateTime? )DateTime.SpecifyKind(args.CTimestampNodaInstantOverride.Value.ToDateTimeUtc(), DateTimeKind.Unspecified)); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(InsertMysqlDatetimeTypesSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(InsertMysqlDatetimeTypesSql, queryParams, transaction: this.Transaction); } @@ -1140,9 +1189,8 @@ public async Task InsertMysqlDatetimeTypesBatchAsync(List { "c_year", "c_date", "c_datetime", "c_timestamp", "c_time" }); await loader.LoadAsync(); - await connection.CloseAsync(); } } @@ -1174,14 +1221,14 @@ public async Task GetMysqlDatetimeTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetMysqlDatetimeTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetMysqlDatetimeTypesSql, transaction: this.Transaction); } @@ -1214,14 +1261,14 @@ public async Task GetMysqlDatetimeTypesCntAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetMysqlDatetimeTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetMysqlDatetimeTypesCntSql, transaction: this.Transaction); } @@ -1231,12 +1278,14 @@ public async Task TruncateMysqlDatetimeTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncateMysqlDatetimeTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncateMysqlDatetimeTypesSql, transaction: this.Transaction); } @@ -1275,12 +1324,14 @@ public async Task InsertMysqlBinaryTypesAsync(InsertMysqlBinaryTypesArgs args) queryParams.Add("c_longblob", args.CLongblob); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(InsertMysqlBinaryTypesSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(InsertMysqlBinaryTypesSql, queryParams, transaction: this.Transaction); } @@ -1322,9 +1373,8 @@ public async Task InsertMysqlBinaryTypesBatchAsync(List { "c_bit", "c_binary", "c_varbinary", "c_tinyblob", "c_blob", "c_mediumblob", "c_longblob" }); await loader.LoadAsync(); - await connection.CloseAsync(); } } @@ -1357,14 +1406,14 @@ public async Task GetMysqlBinaryTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetMysqlBinaryTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetMysqlBinaryTypesSql, transaction: this.Transaction); } @@ -1403,14 +1452,14 @@ public async Task GetMysqlBinaryTypesCntAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetMysqlBinaryTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetMysqlBinaryTypesCntSql, transaction: this.Transaction); } @@ -1420,12 +1469,14 @@ public async Task TruncateMysqlBinaryTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncateMysqlBinaryTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncateMysqlBinaryTypesSql, transaction: this.Transaction); } @@ -1448,14 +1499,14 @@ public async Task GetMysqlFunctionsAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetMysqlFunctionsSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetMysqlFunctionsSql, transaction: this.Transaction); } diff --git a/examples/MySqlConnectorDapperLegacyExample/Utils.cs b/examples/MySqlConnectorDapperLegacyExample/Utils.cs index f77d7ec7..7fd05c0e 100644 --- a/examples/MySqlConnectorDapperLegacyExample/Utils.cs +++ b/examples/MySqlConnectorDapperLegacyExample/Utils.cs @@ -10,6 +10,7 @@ namespace MySqlConnectorDapperLegacyExampleGen using System; using System.Collections.Generic; using System.Data; + using System.Data.Common; using System.Linq; using System.Text.Json; diff --git a/examples/MySqlConnectorExample/Models.cs b/examples/MySqlConnectorExample/Models.cs index d3523e90..30ba0940 100644 --- a/examples/MySqlConnectorExample/Models.cs +++ b/examples/MySqlConnectorExample/Models.cs @@ -3,6 +3,7 @@ using NodaTime.Extensions; using System; using System.Collections.Generic; +using System.Data.Common; using System.Linq; using System.Text.Json; diff --git a/examples/MySqlConnectorExample/QuerySql.cs b/examples/MySqlConnectorExample/QuerySql.cs index 8a148f9b..4399a183 100644 --- a/examples/MySqlConnectorExample/QuerySql.cs +++ b/examples/MySqlConnectorExample/QuerySql.cs @@ -12,14 +12,17 @@ using NodaTime.Extensions; using System; using System.Collections.Generic; +using System.Data; +using System.Data.Common; using System.Globalization; using System.IO; using System.Text; using System.Text.Json; +using System.Threading; using System.Threading.Tasks; namespace MySqlConnectorExampleGen; -public class QuerySql +public class QuerySql : IDisposable { public QuerySql() { @@ -28,6 +31,15 @@ public QuerySql() public QuerySql(string connectionString) : this() { this.ConnectionString = connectionString; + _dataSource = new Lazy(() => + { + var builder = new MySqlConnectionStringBuilder(connectionString!); + builder.ConnectionReset = true; + // Pre-warm connection pool with minimum connections + if (builder.MinimumPoolSize == 0) + builder.MinimumPoolSize = 1; + return new MySqlDataSourceBuilder(builder.ConnectionString).Build(); + }, LazyThreadSafetyMode.ExecutionAndPublication); } private QuerySql(MySqlTransaction transaction) : this() @@ -43,6 +55,21 @@ public static QuerySql WithTransaction(MySqlTransaction transaction) private MySqlTransaction? Transaction { get; } private string? ConnectionString { get; } + private readonly Lazy? _dataSource; + private MySqlDataSource GetDataSource() + { + if (_dataSource == null) + throw new InvalidOperationException("ConnectionString is required when not using a transaction"); + return _dataSource.Value; + } + + public void Dispose() + { + GC.SuppressFinalize(this); + if (_dataSource?.IsValueCreated == true) + _dataSource.Value.Dispose(); + } + private const string GetAuthorSql = "SELECT id, name, bio FROM authors WHERE name = @name LIMIT 1"; public readonly record struct GetAuthorRow(long Id, string Name, string? Bio); public readonly record struct GetAuthorArgs(string Name); @@ -50,11 +77,11 @@ public static QuerySql WithTransaction(MySqlTransaction transaction) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetAuthorSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorSql; command.Parameters.AddWithValue("@name", args.Name); using (var reader = await command.ExecuteReaderAsync()) { @@ -69,12 +96,11 @@ public static QuerySql WithTransaction(MySqlTransaction transaction) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -108,11 +134,11 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(ListAuthorsSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = ListAuthorsSql; command.Parameters.AddWithValue("@limit", args.Limit); command.Parameters.AddWithValue("@offset", args.Offset); using (var reader = await command.ExecuteReaderAsync()) @@ -126,7 +152,7 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -150,22 +176,22 @@ public async Task CreateAuthorAsync(CreateAuthorArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(CreateAuthorSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateAuthorSql; command.Parameters.AddWithValue("@id", args.Id); command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -178,26 +204,26 @@ public async Task CreateAuthorAsync(CreateAuthorArgs args) } } - private const string CreateAuthorReturnIdSql = "INSERT INTO authors (name, bio) VALUES (@name, @bio)"; + private const string CreateAuthorReturnIdSql = "INSERT INTO authors (name, bio) VALUES (@name, @bio); SELECT LAST_INSERT_ID()"; public readonly record struct CreateAuthorReturnIdArgs(string Name, string? Bio); public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(CreateAuthorReturnIdSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateAuthorReturnIdSql; command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); - await command.ExecuteNonQueryAsync(); - return command.LastInsertedId; + var result = await command.ExecuteScalarAsync(); + return Convert.ToInt64(result); } } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -205,8 +231,8 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) command.Transaction = this.Transaction; command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); - await command.ExecuteNonQueryAsync(); - return command.LastInsertedId; + var result = await command.ExecuteScalarAsync(); + return Convert.ToInt64(result); } } @@ -217,11 +243,11 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetAuthorByIdSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorByIdSql; command.Parameters.AddWithValue("@id", args.Id); using (var reader = await command.ExecuteReaderAsync()) { @@ -236,12 +262,11 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -273,11 +298,11 @@ public async Task> GetAuthorByNamePatternAsync(G { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetAuthorByNamePatternSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorByNamePatternSql; command.Parameters.AddWithValue("@name_pattern", args.NamePattern ?? (object)DBNull.Value); using (var reader = await command.ExecuteReaderAsync()) { @@ -290,7 +315,7 @@ public async Task> GetAuthorByNamePatternAsync(G } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -314,20 +339,20 @@ public async Task DeleteAuthorAsync(DeleteAuthorArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(DeleteAuthorSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = DeleteAuthorSql; command.Parameters.AddWithValue("@name", args.Name); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -343,19 +368,19 @@ public async Task DeleteAllAuthorsAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(DeleteAllAuthorsSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = DeleteAllAuthorsSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -373,18 +398,18 @@ public async Task UpdateAuthorsAsync(UpdateAuthorsArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(UpdateAuthorsSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = UpdateAuthorsSql; command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); return await command.ExecuteNonQueryAsync(); } } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -404,11 +429,11 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds transformedSql = Utils.TransformQueryForSliceArgs(transformedSql, args.Ids.Length, "ids"); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(transformedSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = transformedSql; for (int i = 0; i < args.Ids.Length; i++) command.Parameters.AddWithValue($"@idsArg{i}", args.Ids[i]); using (var reader = await command.ExecuteReaderAsync()) @@ -422,7 +447,7 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -450,11 +475,11 @@ public async Task> GetAuthorsByIdsAndNamesAsync transformedSql = Utils.TransformQueryForSliceArgs(transformedSql, args.Names.Length, "names"); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(transformedSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = transformedSql; for (int i = 0; i < args.Ids.Length; i++) command.Parameters.AddWithValue($"@idsArg{i}", args.Ids[i]); for (int i = 0; i < args.Names.Length; i++) @@ -470,7 +495,7 @@ public async Task> GetAuthorsByIdsAndNamesAsync } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -490,26 +515,26 @@ public async Task> GetAuthorsByIdsAndNamesAsync } } - private const string CreateBookSql = "INSERT INTO books (name, author_id) VALUES (@name, @author_id)"; + private const string CreateBookSql = "INSERT INTO books (name, author_id) VALUES (@name, @author_id); SELECT LAST_INSERT_ID()"; public readonly record struct CreateBookArgs(string Name, long AuthorId); public async Task CreateBookAsync(CreateBookArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(CreateBookSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateBookSql; command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@author_id", args.AuthorId); - await command.ExecuteNonQueryAsync(); - return command.LastInsertedId; + var result = await command.ExecuteScalarAsync(); + return Convert.ToInt64(result); } } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -517,8 +542,8 @@ public async Task CreateBookAsync(CreateBookArgs args) command.Transaction = this.Transaction; command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@author_id", args.AuthorId); - await command.ExecuteNonQueryAsync(); - return command.LastInsertedId; + var result = await command.ExecuteScalarAsync(); + return Convert.ToInt64(result); } } @@ -530,11 +555,11 @@ public async Task> ListAllAuthorsBooksAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(ListAllAuthorsBooksSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = ListAllAuthorsBooksSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -546,7 +571,7 @@ public async Task> ListAllAuthorsBooksAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -570,11 +595,11 @@ public async Task> GetDuplicateAuthorsAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetDuplicateAuthorsSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetDuplicateAuthorsSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -586,7 +611,7 @@ public async Task> GetDuplicateAuthorsAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -611,11 +636,11 @@ public async Task> GetAuthorsByBookNameAsync(GetAu { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetAuthorsByBookNameSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorsByBookNameSql; command.Parameters.AddWithValue("@name", args.Name); using (var reader = await command.ExecuteReaderAsync()) { @@ -628,7 +653,7 @@ public async Task> GetAuthorsByBookNameAsync(GetAu } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -651,23 +676,23 @@ public async Task CreateExtendedBioAsync(CreateExtendedBioArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(CreateExtendedBioSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateExtendedBioSql; command.Parameters.AddWithValue("@author_name", args.AuthorName ?? (object)DBNull.Value); command.Parameters.AddWithValue("@name", args.Name ?? (object)DBNull.Value); command.Parameters.AddWithValue("@bio_type", args.BioType ?? (object)DBNull.Value); command.Parameters.AddWithValue("@author_type", args.AuthorType != null ? string.Join(",", args.AuthorType) : (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -688,11 +713,11 @@ public async Task CreateExtendedBioAsync(CreateExtendedBioArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetFirstExtendedBioByTypeSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetFirstExtendedBioByTypeSql; command.Parameters.AddWithValue("@bio_type", args.BioType ?? (object)DBNull.Value); using (var reader = await command.ExecuteReaderAsync()) { @@ -708,12 +733,11 @@ public async Task CreateExtendedBioAsync(CreateExtendedBioArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -743,19 +767,19 @@ public async Task TruncateExtendedBiosAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(TruncateExtendedBiosSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncateExtendedBiosSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -790,11 +814,11 @@ public async Task InsertMysqlNumericTypesAsync(InsertMysqlNumericTypesArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(InsertMysqlNumericTypesSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = InsertMysqlNumericTypesSql; command.Parameters.AddWithValue("@c_bool", args.CBool ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_boolean", args.CBoolean ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_tinyint", args.CTinyint ?? (object)DBNull.Value); @@ -812,12 +836,12 @@ public async Task InsertMysqlNumericTypesAsync(InsertMysqlNumericTypesArgs args) command.Parameters.AddWithValue("@c_double_precision", args.CDoublePrecision ?? (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -874,9 +898,8 @@ public async Task InsertMysqlNumericTypesBatchAsync(List { "c_bool", "c_boolean", "c_tinyint", "c_smallint", "c_mediumint", "c_int", "c_integer", "c_bigint", "c_float", "c_numeric", "c_decimal", "c_dec", "c_fixed", "c_double", "c_double_precision" }); await loader.LoadAsync(); - await connection.CloseAsync(); } } @@ -900,11 +922,11 @@ public async Task InsertMysqlNumericTypesBatchAsync(List { "c_char", "c_nchar", "c_national_char", "c_varchar", "c_tinytext", "c_mediumtext", "c_text", "c_longtext", "c_json", "c_json_string_override", "c_enum", "c_set" }); await loader.LoadAsync(); - await connection.CloseAsync(); } } @@ -1233,11 +1251,11 @@ public async Task InsertMysqlStringTypesBatchAsync(List { "c_year", "c_date", "c_datetime", "c_timestamp", "c_time" }); await loader.LoadAsync(); - await connection.CloseAsync(); } } @@ -1528,11 +1542,11 @@ public async Task InsertMysqlDatetimeTypesBatchAsync(List(4), - CTimestampNodaInstantOverride = reader.IsDBNull(5) ? null : (new Func((r, o) => + CTimestampNodaInstantOverride = reader.IsDBNull(5) ? null : (new Func((r, o) => { var dt = reader.GetDateTime(o); if (dt.Kind != DateTimeKind.Utc) @@ -1555,12 +1569,11 @@ public async Task InsertMysqlDatetimeTypesBatchAsync(List(4), - CTimestampNodaInstantOverride = reader.IsDBNull(5) ? null : (new Func((r, o) => + CTimestampNodaInstantOverride = reader.IsDBNull(5) ? null : (new Func((r, o) => { var dt = reader.GetDateTime(o); if (dt.Kind != DateTimeKind.Utc) @@ -1612,11 +1625,11 @@ GROUP BY { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetMysqlDatetimeTypesCntSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetMysqlDatetimeTypesCntSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -1633,12 +1646,11 @@ GROUP BY } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1669,19 +1681,19 @@ public async Task TruncateMysqlDatetimeTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(TruncateMysqlDatetimeTypesSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncateMysqlDatetimeTypesSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1708,11 +1720,11 @@ public async Task InsertMysqlBinaryTypesAsync(InsertMysqlBinaryTypesArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(InsertMysqlBinaryTypesSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = InsertMysqlBinaryTypesSql; command.Parameters.AddWithValue("@c_bit", args.CBit ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_binary", args.CBinary ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_varbinary", args.CVarbinary ?? (object)DBNull.Value); @@ -1722,12 +1734,12 @@ public async Task InsertMysqlBinaryTypesAsync(InsertMysqlBinaryTypesArgs args) command.Parameters.AddWithValue("@c_longblob", args.CLongblob ?? (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1773,9 +1785,8 @@ public async Task InsertMysqlBinaryTypesBatchAsync(List { "c_bit", "c_binary", "c_varbinary", "c_tinyblob", "c_blob", "c_mediumblob", "c_longblob" }); await loader.LoadAsync(); - await connection.CloseAsync(); } } @@ -1799,11 +1809,11 @@ public async Task InsertMysqlBinaryTypesBatchAsync(List(() => + { + var builder = new MySqlConnectionStringBuilder(connectionString); + builder.ConnectionReset = true; + // Pre-warm connection pool with minimum connections + if (builder.MinimumPoolSize == 0) + builder.MinimumPoolSize = 1; + return new MySqlDataSourceBuilder(builder.ConnectionString).Build(); + }, LazyThreadSafetyMode.ExecutionAndPublication); } private QuerySql(MySqlTransaction transaction) : this() @@ -44,6 +56,21 @@ public static QuerySql WithTransaction(MySqlTransaction transaction) private MySqlTransaction Transaction { get; } private string ConnectionString { get; } + private readonly Lazy _dataSource; + private MySqlDataSource GetDataSource() + { + if (_dataSource == null) + throw new InvalidOperationException("ConnectionString is required when not using a transaction"); + return _dataSource.Value; + } + + public void Dispose() + { + GC.SuppressFinalize(this); + if (_dataSource?.IsValueCreated == true) + _dataSource.Value.Dispose(); + } + private const string GetAuthorSql = "SELECT id, name, bio FROM authors WHERE name = @name LIMIT 1"; public class GetAuthorRow { @@ -59,11 +86,11 @@ public async Task GetAuthorAsync(GetAuthorArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetAuthorSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorSql; command.Parameters.AddWithValue("@name", args.Name); using (var reader = await command.ExecuteReaderAsync()) { @@ -78,12 +105,11 @@ public async Task GetAuthorAsync(GetAuthorArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -126,11 +152,11 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(ListAuthorsSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = ListAuthorsSql; command.Parameters.AddWithValue("@limit", args.Limit); command.Parameters.AddWithValue("@offset", args.Offset); using (var reader = await command.ExecuteReaderAsync()) @@ -144,7 +170,7 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -173,22 +199,22 @@ public async Task CreateAuthorAsync(CreateAuthorArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(CreateAuthorSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateAuthorSql; command.Parameters.AddWithValue("@id", args.Id); command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -201,7 +227,7 @@ public async Task CreateAuthorAsync(CreateAuthorArgs args) } } - private const string CreateAuthorReturnIdSql = "INSERT INTO authors (name, bio) VALUES (@name, @bio)"; + private const string CreateAuthorReturnIdSql = "INSERT INTO authors (name, bio) VALUES (@name, @bio); SELECT LAST_INSERT_ID()"; public class CreateAuthorReturnIdArgs { public string Name { get; set; } @@ -211,20 +237,20 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(CreateAuthorReturnIdSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateAuthorReturnIdSql; command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); - await command.ExecuteNonQueryAsync(); - return command.LastInsertedId; + var result = await command.ExecuteScalarAsync(); + return Convert.ToInt64(result); } } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -232,8 +258,8 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) command.Transaction = this.Transaction; command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); - await command.ExecuteNonQueryAsync(); - return command.LastInsertedId; + var result = await command.ExecuteScalarAsync(); + return Convert.ToInt64(result); } } @@ -252,11 +278,11 @@ public async Task GetAuthorByIdAsync(GetAuthorByIdArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetAuthorByIdSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorByIdSql; command.Parameters.AddWithValue("@id", args.Id); using (var reader = await command.ExecuteReaderAsync()) { @@ -271,12 +297,11 @@ public async Task GetAuthorByIdAsync(GetAuthorByIdArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -316,11 +341,11 @@ public async Task> GetAuthorByNamePatternAsync(G { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetAuthorByNamePatternSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorByNamePatternSql; command.Parameters.AddWithValue("@name_pattern", args.NamePattern ?? (object)DBNull.Value); using (var reader = await command.ExecuteReaderAsync()) { @@ -333,7 +358,7 @@ public async Task> GetAuthorByNamePatternAsync(G } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -360,20 +385,20 @@ public async Task DeleteAuthorAsync(DeleteAuthorArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(DeleteAuthorSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = DeleteAuthorSql; command.Parameters.AddWithValue("@name", args.Name); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -389,19 +414,19 @@ public async Task DeleteAllAuthorsAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(DeleteAllAuthorsSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = DeleteAllAuthorsSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -422,18 +447,18 @@ public async Task UpdateAuthorsAsync(UpdateAuthorsArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(UpdateAuthorsSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = UpdateAuthorsSql; command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); return await command.ExecuteNonQueryAsync(); } } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -461,11 +486,11 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds transformedSql = Utils.TransformQueryForSliceArgs(transformedSql, args.Ids.Length, "ids"); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(transformedSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = transformedSql; for (int i = 0; i < args.Ids.Length; i++) command.Parameters.AddWithValue($"@idsArg{i}", args.Ids[i]); using (var reader = await command.ExecuteReaderAsync()) @@ -479,7 +504,7 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -516,11 +541,11 @@ public async Task> GetAuthorsByIdsAndNamesAsync transformedSql = Utils.TransformQueryForSliceArgs(transformedSql, args.Names.Length, "names"); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(transformedSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = transformedSql; for (int i = 0; i < args.Ids.Length; i++) command.Parameters.AddWithValue($"@idsArg{i}", args.Ids[i]); for (int i = 0; i < args.Names.Length; i++) @@ -536,7 +561,7 @@ public async Task> GetAuthorsByIdsAndNamesAsync } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -556,7 +581,7 @@ public async Task> GetAuthorsByIdsAndNamesAsync } } - private const string CreateBookSql = "INSERT INTO books (name, author_id) VALUES (@name, @author_id)"; + private const string CreateBookSql = "INSERT INTO books (name, author_id) VALUES (@name, @author_id); SELECT LAST_INSERT_ID()"; public class CreateBookArgs { public string Name { get; set; } @@ -566,20 +591,20 @@ public async Task CreateBookAsync(CreateBookArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(CreateBookSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateBookSql; command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@author_id", args.AuthorId); - await command.ExecuteNonQueryAsync(); - return command.LastInsertedId; + var result = await command.ExecuteScalarAsync(); + return Convert.ToInt64(result); } } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -587,8 +612,8 @@ public async Task CreateBookAsync(CreateBookArgs args) command.Transaction = this.Transaction; command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@author_id", args.AuthorId); - await command.ExecuteNonQueryAsync(); - return command.LastInsertedId; + var result = await command.ExecuteScalarAsync(); + return Convert.ToInt64(result); } } @@ -604,11 +629,11 @@ public async Task> ListAllAuthorsBooksAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(ListAllAuthorsBooksSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = ListAllAuthorsBooksSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -620,7 +645,7 @@ public async Task> ListAllAuthorsBooksAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -648,11 +673,11 @@ public async Task> GetDuplicateAuthorsAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetDuplicateAuthorsSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetDuplicateAuthorsSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -664,7 +689,7 @@ public async Task> GetDuplicateAuthorsAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -698,11 +723,11 @@ public async Task> GetAuthorsByBookNameAsync(GetAu { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetAuthorsByBookNameSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorsByBookNameSql; command.Parameters.AddWithValue("@name", args.Name); using (var reader = await command.ExecuteReaderAsync()) { @@ -715,7 +740,7 @@ public async Task> GetAuthorsByBookNameAsync(GetAu } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -744,23 +769,23 @@ public async Task CreateExtendedBioAsync(CreateExtendedBioArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(CreateExtendedBioSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateExtendedBioSql; command.Parameters.AddWithValue("@author_name", args.AuthorName ?? (object)DBNull.Value); command.Parameters.AddWithValue("@name", args.Name ?? (object)DBNull.Value); command.Parameters.AddWithValue("@bio_type", args.BioType ?? (object)DBNull.Value); command.Parameters.AddWithValue("@author_type", args.AuthorType != null ? string.Join(",", args.AuthorType) : (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -790,11 +815,11 @@ public async Task GetFirstExtendedBioByTypeAsync(G { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetFirstExtendedBioByTypeSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetFirstExtendedBioByTypeSql; command.Parameters.AddWithValue("@bio_type", args.BioType ?? (object)DBNull.Value); using (var reader = await command.ExecuteReaderAsync()) { @@ -810,12 +835,11 @@ public async Task GetFirstExtendedBioByTypeAsync(G } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -845,19 +869,19 @@ public async Task TruncateExtendedBiosAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(TruncateExtendedBiosSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncateExtendedBiosSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -909,11 +933,11 @@ public async Task InsertMysqlNumericTypesAsync(InsertMysqlNumericTypesArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(InsertMysqlNumericTypesSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = InsertMysqlNumericTypesSql; command.Parameters.AddWithValue("@c_bool", args.CBool ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_boolean", args.CBoolean ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_tinyint", args.CTinyint ?? (object)DBNull.Value); @@ -931,12 +955,12 @@ public async Task InsertMysqlNumericTypesAsync(InsertMysqlNumericTypesArgs args) command.Parameters.AddWithValue("@c_double_precision", args.CDoublePrecision ?? (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1010,9 +1034,8 @@ public async Task InsertMysqlNumericTypesBatchAsync(List { "c_bool", "c_boolean", "c_tinyint", "c_smallint", "c_mediumint", "c_int", "c_integer", "c_bigint", "c_float", "c_numeric", "c_decimal", "c_dec", "c_fixed", "c_double", "c_double_precision" }); await loader.LoadAsync(); - await connection.CloseAsync(); } } @@ -1053,11 +1075,11 @@ public async Task GetMysqlNumericTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetMysqlNumericTypesSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetMysqlNumericTypesSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -1083,12 +1105,11 @@ public async Task GetMysqlNumericTypesAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1181,11 +1202,11 @@ public async Task GetMysqlNumericTypesCntAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetMysqlNumericTypesCntSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetMysqlNumericTypesCntSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -1212,12 +1233,11 @@ public async Task GetMysqlNumericTypesCntAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1258,19 +1278,19 @@ public async Task TruncateMysqlNumericTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(TruncateMysqlNumericTypesSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncateMysqlNumericTypesSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1316,11 +1336,11 @@ public async Task InsertMysqlStringTypesAsync(InsertMysqlStringTypesArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(InsertMysqlStringTypesSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = InsertMysqlStringTypesSql; command.Parameters.AddWithValue("@c_char", args.CChar ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_nchar", args.CNchar ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_national_char", args.CNationalChar ?? (object)DBNull.Value); @@ -1335,12 +1355,12 @@ public async Task InsertMysqlStringTypesAsync(InsertMysqlStringTypesArgs args) command.Parameters.AddWithValue("@c_set", args.CSet != null ? string.Join(",", args.CSet) : (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1405,9 +1425,8 @@ public async Task InsertMysqlStringTypesBatchAsync(List { "c_char", "c_nchar", "c_national_char", "c_varchar", "c_tinytext", "c_mediumtext", "c_text", "c_longtext", "c_json", "c_json_string_override", "c_enum", "c_set" }); await loader.LoadAsync(); - await connection.CloseAsync(); } } @@ -1445,11 +1463,11 @@ public async Task GetMysqlStringTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetMysqlStringTypesSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetMysqlStringTypesSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -1472,12 +1490,11 @@ public async Task GetMysqlStringTypesAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1558,11 +1575,11 @@ public async Task GetMysqlStringTypesCntAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetMysqlStringTypesCntSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetMysqlStringTypesCntSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -1586,12 +1603,11 @@ public async Task GetMysqlStringTypesCntAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1629,19 +1645,19 @@ public async Task TruncateMysqlStringTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(TruncateMysqlStringTypesSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncateMysqlStringTypesSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1675,11 +1691,11 @@ public async Task InsertMysqlDatetimeTypesAsync(InsertMysqlDatetimeTypesArgs arg { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(InsertMysqlDatetimeTypesSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = InsertMysqlDatetimeTypesSql; command.Parameters.AddWithValue("@c_year", args.CYear ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_date", args.CDate ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_datetime", args.CDatetime ?? (object)DBNull.Value); @@ -1688,12 +1704,12 @@ public async Task InsertMysqlDatetimeTypesAsync(InsertMysqlDatetimeTypesArgs arg command.Parameters.AddWithValue("@c_timestamp_noda_instant_override", args.CTimestampNodaInstantOverride is null ? (object)DBNull.Value : (DateTime? )DateTime.SpecifyKind(args.CTimestampNodaInstantOverride.Value.ToDateTimeUtc(), DateTimeKind.Unspecified)); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1744,9 +1760,8 @@ public async Task InsertMysqlDatetimeTypesBatchAsync(List { "c_year", "c_date", "c_datetime", "c_timestamp", "c_time" }); await loader.LoadAsync(); - await connection.CloseAsync(); } } @@ -1778,11 +1792,11 @@ public async Task GetMysqlDatetimeTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetMysqlDatetimeTypesSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetMysqlDatetimeTypesSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -1794,7 +1808,7 @@ public async Task GetMysqlDatetimeTypesAsync() CDatetime = reader.IsDBNull(2) ? (DateTime? )null : reader.GetDateTime(2), CTimestamp = reader.IsDBNull(3) ? (DateTime? )null : reader.GetDateTime(3), CTime = reader.IsDBNull(4) ? (TimeSpan? )null : reader.GetFieldValue(4), - CTimestampNodaInstantOverride = reader.IsDBNull(5) ? (Instant? )null : (new Func((r, o) => + CTimestampNodaInstantOverride = reader.IsDBNull(5) ? (Instant? )null : (new Func((r, o) => { var dt = reader.GetDateTime(o); if (dt.Kind != DateTimeKind.Utc) @@ -1805,12 +1819,11 @@ public async Task GetMysqlDatetimeTypesAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1827,7 +1840,7 @@ public async Task GetMysqlDatetimeTypesAsync() CDatetime = reader.IsDBNull(2) ? (DateTime? )null : reader.GetDateTime(2), CTimestamp = reader.IsDBNull(3) ? (DateTime? )null : reader.GetDateTime(3), CTime = reader.IsDBNull(4) ? (TimeSpan? )null : reader.GetFieldValue(4), - CTimestampNodaInstantOverride = reader.IsDBNull(5) ? (Instant? )null : (new Func((r, o) => + CTimestampNodaInstantOverride = reader.IsDBNull(5) ? (Instant? )null : (new Func((r, o) => { var dt = reader.GetDateTime(o); if (dt.Kind != DateTimeKind.Utc) @@ -1870,11 +1883,11 @@ public async Task GetMysqlDatetimeTypesCntAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetMysqlDatetimeTypesCntSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetMysqlDatetimeTypesCntSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -1891,12 +1904,11 @@ public async Task GetMysqlDatetimeTypesCntAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1927,19 +1939,19 @@ public async Task TruncateMysqlDatetimeTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(TruncateMysqlDatetimeTypesSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncateMysqlDatetimeTypesSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1975,11 +1987,11 @@ public async Task InsertMysqlBinaryTypesAsync(InsertMysqlBinaryTypesArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(InsertMysqlBinaryTypesSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = InsertMysqlBinaryTypesSql; command.Parameters.AddWithValue("@c_bit", args.CBit ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_binary", args.CBinary ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_varbinary", args.CVarbinary ?? (object)DBNull.Value); @@ -1989,12 +2001,12 @@ public async Task InsertMysqlBinaryTypesAsync(InsertMysqlBinaryTypesArgs args) command.Parameters.AddWithValue("@c_longblob", args.CLongblob ?? (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -2048,9 +2060,8 @@ public async Task InsertMysqlBinaryTypesBatchAsync(List { "c_bit", "c_binary", "c_varbinary", "c_tinyblob", "c_blob", "c_mediumblob", "c_longblob" }); await loader.LoadAsync(); - await connection.CloseAsync(); } } @@ -2083,11 +2093,11 @@ public async Task GetMysqlBinaryTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetMysqlBinaryTypesSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetMysqlBinaryTypesSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -2105,12 +2115,11 @@ public async Task GetMysqlBinaryTypesAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -2171,11 +2180,11 @@ public async Task GetMysqlBinaryTypesCntAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetMysqlBinaryTypesCntSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetMysqlBinaryTypesCntSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -2194,12 +2203,11 @@ public async Task GetMysqlBinaryTypesCntAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -2232,19 +2240,19 @@ public async Task TruncateMysqlBinaryTypesAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(TruncateMysqlBinaryTypesSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncateMysqlBinaryTypesSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -2272,11 +2280,11 @@ public async Task GetMysqlFunctionsAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetMysqlFunctionsSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetMysqlFunctionsSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -2290,12 +2298,11 @@ public async Task GetMysqlFunctionsAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { diff --git a/examples/NpgsqlDapperExample/QuerySql.cs b/examples/NpgsqlDapperExample/QuerySql.cs index 52f6bf44..9312d8c8 100644 --- a/examples/NpgsqlDapperExample/QuerySql.cs +++ b/examples/NpgsqlDapperExample/QuerySql.cs @@ -15,21 +15,23 @@ using System.Net; using System.Net.NetworkInformation; using System.Text.Json; +using System.Threading; using System.Threading.Tasks; using System.Xml; namespace NpgsqlDapperExampleGen; -public class QuerySql +public class QuerySql : IDisposable { public QuerySql() { Utils.ConfigureSqlMapper(); - Dapper.DefaultTypeMap.MatchNamesWithUnderscores = true; + DefaultTypeMap.MatchNamesWithUnderscores = true; } public QuerySql(string connectionString) : this() { this.ConnectionString = connectionString; + _dataSource = new Lazy(() => NpgsqlDataSource.Create(connectionString!), LazyThreadSafetyMode.ExecutionAndPublication); } private QuerySql(NpgsqlTransaction transaction) : this() @@ -45,6 +47,21 @@ public static QuerySql WithTransaction(NpgsqlTransaction transaction) private NpgsqlTransaction? Transaction { get; } private string? ConnectionString { get; } + private readonly Lazy? _dataSource; + private NpgsqlDataSource GetDataSource() + { + if (_dataSource == null) + throw new InvalidOperationException("ConnectionString is required when not using a transaction"); + return _dataSource.Value; + } + + public void Dispose() + { + GC.SuppressFinalize(this); + if (_dataSource?.IsValueCreated == true) + _dataSource.Value.Dispose(); + } + private const string GetAuthorSql = @"SELECT id, name, bio FROM authors WHERE name = @name LIMIT 1"; public class GetAuthorRow @@ -63,14 +80,14 @@ public class GetAuthorArgs queryParams.Add("name", args.Name); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetAuthorSql, queryParams); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetAuthorSql, queryParams, transaction: this.Transaction); } @@ -98,14 +115,14 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) queryParams.Add("limit", args.Limit); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryAsync(ListAuthorsSql, queryParams); return result.AsList(); } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(ListAuthorsSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -131,14 +148,14 @@ public class CreateAuthorArgs queryParams.Add("bio", args.Bio); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(CreateAuthorSql, queryParams); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(CreateAuthorSql, queryParams, transaction: this.Transaction); } @@ -160,11 +177,13 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) queryParams.Add("bio", args.Bio); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { return await connection.QuerySingleAsync(CreateAuthorReturnIdSql, queryParams); + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QuerySingleAsync(CreateAuthorReturnIdSql, queryParams, transaction: this.Transaction); } @@ -187,14 +206,14 @@ public class GetAuthorByIdArgs queryParams.Add("id", args.Id); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetAuthorByIdSql, queryParams); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetAuthorByIdSql, queryParams, transaction: this.Transaction); } @@ -217,14 +236,14 @@ public async Task> GetAuthorByNamePatternAsync(G queryParams.Add("name_pattern", args.NamePattern); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryAsync(GetAuthorByNamePatternSql, queryParams); return result.AsList(); } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(GetAuthorByNamePatternSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -241,12 +260,14 @@ public async Task DeleteAuthorAsync(DeleteAuthorArgs args) queryParams.Add("name", args.Name); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(DeleteAuthorSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(DeleteAuthorSql, queryParams, transaction: this.Transaction); } @@ -256,12 +277,14 @@ public async Task TruncateAuthorsAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncateAuthorsSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncateAuthorsSql, transaction: this.Transaction); } @@ -279,11 +302,13 @@ public async Task UpdateAuthorsAsync(UpdateAuthorsArgs args) queryParams.Add("bio", args.Bio); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { return await connection.ExecuteAsync(UpdateAuthorsSql, queryParams); + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.ExecuteAsync(UpdateAuthorsSql, queryParams, transaction: this.Transaction); } @@ -306,14 +331,14 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds queryParams.Add("longArr_1", args.LongArr1); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryAsync(GetAuthorsByIdsSql, queryParams); return result.AsList(); } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(GetAuthorsByIdsSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -339,14 +364,14 @@ public async Task> GetAuthorsByIdsAndNamesAsync queryParams.Add("stringArr_2", args.StringArr2); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryAsync(GetAuthorsByIdsAndNamesSql, queryParams); return result.AsList(); } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(GetAuthorsByIdsAndNamesSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -368,11 +393,13 @@ public async Task CreateBookAsync(CreateBookArgs args) queryParams.Add("author_id", args.AuthorId); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { return await connection.QuerySingleAsync(CreateBookSql, queryParams); + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QuerySingleAsync(CreateBookSql, queryParams, transaction: this.Transaction); } @@ -392,10 +419,11 @@ public async Task> ListAllAuthorsBooksAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(ListAllAuthorsBooksSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = ListAllAuthorsBooksSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -407,7 +435,7 @@ public async Task> ListAllAuthorsBooksAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -438,10 +466,11 @@ public async Task> GetDuplicateAuthorsAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetDuplicateAuthorsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetDuplicateAuthorsSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -453,7 +482,7 @@ public async Task> GetDuplicateAuthorsAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -489,10 +518,11 @@ public async Task> GetAuthorsByBookNameAsync(GetAu { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorsByBookNameSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorsByBookNameSql; command.Parameters.AddWithValue("@name", args.Name); using (var reader = await command.ExecuteReaderAsync()) { @@ -505,7 +535,7 @@ public async Task> GetAuthorsByBookNameAsync(GetAu } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -537,12 +567,14 @@ public async Task CreateExtendedBioAsync(CreateExtendedBioArgs args) queryParams.Add("bio_type", args.BioType != null ? args.BioType.Value.Stringify() : null); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(CreateExtendedBioSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(CreateExtendedBioSql, queryParams, transaction: this.Transaction); } @@ -564,14 +596,14 @@ public class GetFirstExtendedBioByTypeArgs queryParams.Add("bio_type", args.BioType != null ? args.BioType.Value.Stringify() : null); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetFirstExtendedBioByTypeSql, queryParams); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetFirstExtendedBioByTypeSql, queryParams, transaction: this.Transaction); } @@ -581,12 +613,14 @@ public async Task TruncateExtendedBiosAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncateExtendedBiosSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncateExtendedBiosSql, transaction: this.Transaction); } @@ -608,14 +642,14 @@ public class GetPostgresFunctionsRow { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresFunctionsSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresFunctionsSql, transaction: this.Transaction); } @@ -663,12 +697,14 @@ public async Task InsertPostgresNumericTypesAsync(InsertPostgresNumericTypesArgs queryParams.Add("c_money", args.CMoney); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(InsertPostgresNumericTypesSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(InsertPostgresNumericTypesSql, queryParams, transaction: this.Transaction); } @@ -691,14 +727,14 @@ public class GetPostgresNumericTypesRow { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresNumericTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresNumericTypesSql, transaction: this.Transaction); } @@ -708,12 +744,14 @@ public async Task TruncatePostgresNumericTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncatePostgresNumericTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncatePostgresNumericTypesSql, transaction: this.Transaction); } @@ -761,14 +799,14 @@ public class GetPostgresNumericTypesCntRow { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresNumericTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresNumericTypesCntSql, transaction: this.Transaction); } @@ -789,9 +827,8 @@ public class InsertPostgresNumericTypesBatchArgs }; public async Task InsertPostgresNumericTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresNumericTypesBatchSql)) { foreach (var row in args) @@ -811,8 +848,6 @@ public async Task InsertPostgresNumericTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresStringTypesBatchSql)) { foreach (var row in args) @@ -882,8 +918,6 @@ public async Task InsertPostgresStringTypesBatchAsync(List(GetPostgresStringTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresStringTypesSql, transaction: this.Transaction); } @@ -917,12 +951,14 @@ public async Task TruncatePostgresStringTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncatePostgresStringTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncatePostgresStringTypesSql, transaction: this.Transaction); } @@ -955,14 +991,14 @@ public class GetPostgresStringTypesCntRow { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresStringTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresStringTypesCntSql, transaction: this.Transaction); } @@ -997,14 +1033,14 @@ public class GetPostgresStringTypesTextSearchArgs queryParams.Add("to_tsquery", args.ToTsquery); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresStringTypesTextSearchSql, queryParams); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresStringTypesTextSearchSql, queryParams, transaction: this.Transaction); } @@ -1039,12 +1075,14 @@ public async Task InsertPostgresDateTimeTypesAsync(InsertPostgresDateTimeTypesAr queryParams.Add("c_timestamp_noda_instant_override", args.CTimestampNodaInstantOverride is null ? null : (DateTime? )DateTime.SpecifyKind(args.CTimestampNodaInstantOverride.Value.ToDateTimeUtc(), DateTimeKind.Unspecified)); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(InsertPostgresDateTimeTypesSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(InsertPostgresDateTimeTypesSql, queryParams, transaction: this.Transaction); } @@ -1063,14 +1101,14 @@ public class GetPostgresDateTimeTypesRow { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresDateTimeTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresDateTimeTypesSql, transaction: this.Transaction); } @@ -1080,12 +1118,14 @@ public async Task TruncatePostgresDateTimeTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncatePostgresDateTimeTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncatePostgresDateTimeTypesSql, transaction: this.Transaction); } @@ -1118,14 +1158,14 @@ public class GetPostgresDateTimeTypesCntRow { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresDateTimeTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresDateTimeTypesCntSql, transaction: this.Transaction); } @@ -1141,9 +1181,8 @@ public class InsertPostgresDateTimeTypesBatchArgs }; public async Task InsertPostgresDateTimeTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresDateTimeTypesBatchSql)) { foreach (var row in args) @@ -1158,8 +1197,6 @@ public async Task InsertPostgresDateTimeTypesBatchAsync(List(GetPostgresNetworkTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresNetworkTypesSql, transaction: this.Transaction); } @@ -1237,12 +1276,14 @@ public async Task TruncatePostgresNetworkTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncatePostgresNetworkTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncatePostgresNetworkTypesSql, transaction: this.Transaction); } @@ -1269,14 +1310,14 @@ public class GetPostgresNetworkTypesCntRow { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresNetworkTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresNetworkTypesCntSql, transaction: this.Transaction); } @@ -1290,9 +1331,8 @@ public class InsertPostgresNetworkTypesBatchArgs }; public async Task InsertPostgresNetworkTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresNetworkTypesBatchSql)) { foreach (var row in args) @@ -1305,8 +1345,6 @@ public async Task InsertPostgresNetworkTypesBatchAsync(List(GetPostgresNotNullTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresNotNullTypesSql, transaction: this.Transaction); } @@ -1422,12 +1464,14 @@ public async Task TruncatePostgresNotNullTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncatePostgresNotNullTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncatePostgresNotNullTypesSql, transaction: this.Transaction); } @@ -1458,14 +1502,14 @@ public class GetPostgresSpecialTypesRow { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresSpecialTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresSpecialTypesSql, transaction: this.Transaction); } @@ -1475,12 +1519,14 @@ public async Task TruncatePostgresSpecialTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncatePostgresSpecialTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncatePostgresSpecialTypesSql, transaction: this.Transaction); } @@ -1494,9 +1540,8 @@ public class InsertPostgresSpecialTypesBatchArgs }; public async Task InsertPostgresSpecialTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresSpecialTypesBatchSql)) { foreach (var row in args) @@ -1509,8 +1554,6 @@ public async Task InsertPostgresSpecialTypesBatchAsync(List(GetPostgresSpecialTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresSpecialTypesCntSql, transaction: this.Transaction); } @@ -1591,12 +1634,14 @@ public async Task InsertPostgresArrayTypesAsync(InsertPostgresArrayTypesArgs arg queryParams.Add("c_timestamp_array", args.CTimestampArray); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(InsertPostgresArrayTypesSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(InsertPostgresArrayTypesSql, queryParams, transaction: this.Transaction); } @@ -1616,14 +1661,14 @@ public class GetPostgresArrayTypesRow { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresArrayTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresArrayTypesSql, transaction: this.Transaction); } @@ -1640,9 +1685,8 @@ public class InsertPostgresArrayTypesBatchArgs }; public async Task InsertPostgresArrayTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresArrayTypesBatchSql)) { foreach (var row in args) @@ -1658,8 +1702,6 @@ public async Task InsertPostgresArrayTypesBatchAsync(List(GetPostgresArrayTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresArrayTypesCntSql, transaction: this.Transaction); } @@ -1711,12 +1753,14 @@ public async Task TruncatePostgresArrayTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncatePostgresArrayTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncatePostgresArrayTypesSql, transaction: this.Transaction); } @@ -1754,12 +1798,14 @@ public async Task InsertPostgresGeoTypesAsync(InsertPostgresGeoTypesArgs args) queryParams.Add("c_circle", args.CCircle); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(InsertPostgresGeoTypesSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(InsertPostgresGeoTypesSql, queryParams, transaction: this.Transaction); } @@ -1777,9 +1823,8 @@ public class InsertPostgresGeoTypesBatchArgs }; public async Task InsertPostgresGeoTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresGeoTypesBatchSql)) { foreach (var row in args) @@ -1796,8 +1841,6 @@ public async Task InsertPostgresGeoTypesBatchAsync(List(GetPostgresGeoTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresGeoTypesSql, transaction: this.Transaction); } @@ -1833,12 +1876,14 @@ public async Task TruncatePostgresGeoTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncatePostgresGeoTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncatePostgresGeoTypesSql, transaction: this.Transaction); } diff --git a/examples/NpgsqlDapperLegacyExample/QuerySql.cs b/examples/NpgsqlDapperLegacyExample/QuerySql.cs index 7ffe9462..39ab5771 100644 --- a/examples/NpgsqlDapperLegacyExample/QuerySql.cs +++ b/examples/NpgsqlDapperLegacyExample/QuerySql.cs @@ -17,20 +17,22 @@ namespace NpgsqlDapperLegacyExampleGen using System.Net; using System.Net.NetworkInformation; using System.Text.Json; + using System.Threading; using System.Threading.Tasks; using System.Xml; - public class QuerySql + public class QuerySql : IDisposable { public QuerySql() { Utils.ConfigureSqlMapper(); - Dapper.DefaultTypeMap.MatchNamesWithUnderscores = true; + DefaultTypeMap.MatchNamesWithUnderscores = true; } public QuerySql(string connectionString) : this() { this.ConnectionString = connectionString; + _dataSource = new Lazy(() => NpgsqlDataSource.Create(connectionString), LazyThreadSafetyMode.ExecutionAndPublication); } private QuerySql(NpgsqlTransaction transaction) : this() @@ -46,6 +48,21 @@ public static QuerySql WithTransaction(NpgsqlTransaction transaction) private NpgsqlTransaction Transaction { get; } private string ConnectionString { get; } + private readonly Lazy _dataSource; + private NpgsqlDataSource GetDataSource() + { + if (_dataSource == null) + throw new InvalidOperationException("ConnectionString is required when not using a transaction"); + return _dataSource.Value; + } + + public void Dispose() + { + GC.SuppressFinalize(this); + if (_dataSource?.IsValueCreated == true) + _dataSource.Value.Dispose(); + } + private const string GetAuthorSql = @"SELECT id, name, bio FROM authors WHERE name = @name LIMIT 1"; public class GetAuthorRow @@ -64,14 +81,14 @@ public async Task GetAuthorAsync(GetAuthorArgs args) queryParams.Add("name", args.Name); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetAuthorSql, queryParams); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetAuthorSql, queryParams, transaction: this.Transaction); } @@ -99,14 +116,14 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) queryParams.Add("limit", args.Limit); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryAsync(ListAuthorsSql, queryParams); return result.AsList(); } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(ListAuthorsSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -132,14 +149,14 @@ public async Task CreateAuthorAsync(CreateAuthorArgs args) queryParams.Add("bio", args.Bio); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(CreateAuthorSql, queryParams); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(CreateAuthorSql, queryParams, transaction: this.Transaction); } @@ -161,11 +178,13 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) queryParams.Add("bio", args.Bio); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { return await connection.QuerySingleAsync(CreateAuthorReturnIdSql, queryParams); + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QuerySingleAsync(CreateAuthorReturnIdSql, queryParams, transaction: this.Transaction); } @@ -188,14 +207,14 @@ public async Task GetAuthorByIdAsync(GetAuthorByIdArgs args) queryParams.Add("id", args.Id); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetAuthorByIdSql, queryParams); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetAuthorByIdSql, queryParams, transaction: this.Transaction); } @@ -218,14 +237,14 @@ public async Task> GetAuthorByNamePatternAsync(G queryParams.Add("name_pattern", args.NamePattern); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryAsync(GetAuthorByNamePatternSql, queryParams); return result.AsList(); } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(GetAuthorByNamePatternSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -242,12 +261,14 @@ public async Task DeleteAuthorAsync(DeleteAuthorArgs args) queryParams.Add("name", args.Name); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(DeleteAuthorSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(DeleteAuthorSql, queryParams, transaction: this.Transaction); } @@ -257,12 +278,14 @@ public async Task TruncateAuthorsAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncateAuthorsSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncateAuthorsSql, transaction: this.Transaction); } @@ -280,11 +303,13 @@ public async Task UpdateAuthorsAsync(UpdateAuthorsArgs args) queryParams.Add("bio", args.Bio); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { return await connection.ExecuteAsync(UpdateAuthorsSql, queryParams); + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.ExecuteAsync(UpdateAuthorsSql, queryParams, transaction: this.Transaction); } @@ -307,14 +332,14 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds queryParams.Add("longArr_1", args.LongArr1); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryAsync(GetAuthorsByIdsSql, queryParams); return result.AsList(); } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(GetAuthorsByIdsSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -340,14 +365,14 @@ public async Task> GetAuthorsByIdsAndNamesAsync queryParams.Add("stringArr_2", args.StringArr2); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryAsync(GetAuthorsByIdsAndNamesSql, queryParams); return result.AsList(); } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(GetAuthorsByIdsAndNamesSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -369,11 +394,13 @@ public async Task CreateBookAsync(CreateBookArgs args) queryParams.Add("author_id", args.AuthorId); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { return await connection.QuerySingleAsync(CreateBookSql, queryParams); + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QuerySingleAsync(CreateBookSql, queryParams, transaction: this.Transaction); } @@ -393,10 +420,11 @@ public async Task> ListAllAuthorsBooksAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(ListAllAuthorsBooksSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = ListAllAuthorsBooksSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -408,7 +436,7 @@ public async Task> ListAllAuthorsBooksAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -439,10 +467,11 @@ public async Task> GetDuplicateAuthorsAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetDuplicateAuthorsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetDuplicateAuthorsSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -454,7 +483,7 @@ public async Task> GetDuplicateAuthorsAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -490,10 +519,11 @@ public async Task> GetAuthorsByBookNameAsync(GetAu { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorsByBookNameSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorsByBookNameSql; command.Parameters.AddWithValue("@name", args.Name); using (var reader = await command.ExecuteReaderAsync()) { @@ -506,7 +536,7 @@ public async Task> GetAuthorsByBookNameAsync(GetAu } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -538,12 +568,14 @@ public async Task CreateExtendedBioAsync(CreateExtendedBioArgs args) queryParams.Add("bio_type", args.BioType != null ? args.BioType.Value.Stringify() : null); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(CreateExtendedBioSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(CreateExtendedBioSql, queryParams, transaction: this.Transaction); } @@ -565,14 +597,14 @@ public async Task GetFirstExtendedBioByTypeAsync(G queryParams.Add("bio_type", args.BioType != null ? args.BioType.Value.Stringify() : null); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetFirstExtendedBioByTypeSql, queryParams); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetFirstExtendedBioByTypeSql, queryParams, transaction: this.Transaction); } @@ -582,12 +614,14 @@ public async Task TruncateExtendedBiosAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncateExtendedBiosSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncateExtendedBiosSql, transaction: this.Transaction); } @@ -609,14 +643,14 @@ public async Task GetPostgresFunctionsAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresFunctionsSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresFunctionsSql, transaction: this.Transaction); } @@ -664,12 +698,14 @@ public async Task InsertPostgresNumericTypesAsync(InsertPostgresNumericTypesArgs queryParams.Add("c_money", args.CMoney); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(InsertPostgresNumericTypesSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(InsertPostgresNumericTypesSql, queryParams, transaction: this.Transaction); } @@ -692,14 +728,14 @@ public async Task GetPostgresNumericTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresNumericTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresNumericTypesSql, transaction: this.Transaction); } @@ -709,12 +745,14 @@ public async Task TruncatePostgresNumericTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncatePostgresNumericTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncatePostgresNumericTypesSql, transaction: this.Transaction); } @@ -762,14 +800,14 @@ public async Task GetPostgresNumericTypesCntAsync { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresNumericTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresNumericTypesCntSql, transaction: this.Transaction); } @@ -790,9 +828,8 @@ public class InsertPostgresNumericTypesBatchArgs }; public async Task InsertPostgresNumericTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresNumericTypesBatchSql)) { foreach (var row in args) @@ -812,8 +849,6 @@ public async Task InsertPostgresNumericTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresStringTypesBatchSql)) { foreach (var row in args) @@ -883,8 +919,6 @@ public async Task InsertPostgresStringTypesBatchAsync(List GetPostgresStringTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresStringTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresStringTypesSql, transaction: this.Transaction); } @@ -918,12 +952,14 @@ public async Task TruncatePostgresStringTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncatePostgresStringTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncatePostgresStringTypesSql, transaction: this.Transaction); } @@ -956,14 +992,14 @@ public async Task GetPostgresStringTypesCntAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresStringTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresStringTypesCntSql, transaction: this.Transaction); } @@ -998,14 +1034,14 @@ public async Task GetPostgresStringTypesTex queryParams.Add("to_tsquery", args.ToTsquery); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresStringTypesTextSearchSql, queryParams); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresStringTypesTextSearchSql, queryParams, transaction: this.Transaction); } @@ -1040,12 +1076,14 @@ public async Task InsertPostgresDateTimeTypesAsync(InsertPostgresDateTimeTypesAr queryParams.Add("c_timestamp_noda_instant_override", args.CTimestampNodaInstantOverride is null ? null : (DateTime? )DateTime.SpecifyKind(args.CTimestampNodaInstantOverride.Value.ToDateTimeUtc(), DateTimeKind.Unspecified)); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(InsertPostgresDateTimeTypesSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(InsertPostgresDateTimeTypesSql, queryParams, transaction: this.Transaction); } @@ -1064,14 +1102,14 @@ public async Task GetPostgresDateTimeTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresDateTimeTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresDateTimeTypesSql, transaction: this.Transaction); } @@ -1081,12 +1119,14 @@ public async Task TruncatePostgresDateTimeTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncatePostgresDateTimeTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncatePostgresDateTimeTypesSql, transaction: this.Transaction); } @@ -1119,14 +1159,14 @@ public async Task GetPostgresDateTimeTypesCntAsy { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresDateTimeTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresDateTimeTypesCntSql, transaction: this.Transaction); } @@ -1142,9 +1182,8 @@ public class InsertPostgresDateTimeTypesBatchArgs }; public async Task InsertPostgresDateTimeTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresDateTimeTypesBatchSql)) { foreach (var row in args) @@ -1159,8 +1198,6 @@ public async Task InsertPostgresDateTimeTypesBatchAsync(List GetPostgresNetworkTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresNetworkTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresNetworkTypesSql, transaction: this.Transaction); } @@ -1238,12 +1277,14 @@ public async Task TruncatePostgresNetworkTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncatePostgresNetworkTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncatePostgresNetworkTypesSql, transaction: this.Transaction); } @@ -1270,14 +1311,14 @@ public async Task GetPostgresNetworkTypesCntAsync { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresNetworkTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresNetworkTypesCntSql, transaction: this.Transaction); } @@ -1291,9 +1332,8 @@ public class InsertPostgresNetworkTypesBatchArgs }; public async Task InsertPostgresNetworkTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresNetworkTypesBatchSql)) { foreach (var row in args) @@ -1306,8 +1346,6 @@ public async Task InsertPostgresNetworkTypesBatchAsync(List GetPostgresNotNullTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresNotNullTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresNotNullTypesSql, transaction: this.Transaction); } @@ -1423,12 +1465,14 @@ public async Task TruncatePostgresNotNullTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncatePostgresNotNullTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncatePostgresNotNullTypesSql, transaction: this.Transaction); } @@ -1459,14 +1503,14 @@ public async Task GetPostgresSpecialTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresSpecialTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresSpecialTypesSql, transaction: this.Transaction); } @@ -1476,12 +1520,14 @@ public async Task TruncatePostgresSpecialTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncatePostgresSpecialTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncatePostgresSpecialTypesSql, transaction: this.Transaction); } @@ -1495,9 +1541,8 @@ public class InsertPostgresSpecialTypesBatchArgs }; public async Task InsertPostgresSpecialTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresSpecialTypesBatchSql)) { foreach (var row in args) @@ -1510,8 +1555,6 @@ public async Task InsertPostgresSpecialTypesBatchAsync(List GetPostgresSpecialTypesCntAsync { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresSpecialTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresSpecialTypesCntSql, transaction: this.Transaction); } @@ -1592,12 +1635,14 @@ public async Task InsertPostgresArrayTypesAsync(InsertPostgresArrayTypesArgs arg queryParams.Add("c_timestamp_array", args.CTimestampArray); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(InsertPostgresArrayTypesSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(InsertPostgresArrayTypesSql, queryParams, transaction: this.Transaction); } @@ -1617,14 +1662,14 @@ public async Task GetPostgresArrayTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresArrayTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresArrayTypesSql, transaction: this.Transaction); } @@ -1641,9 +1686,8 @@ public class InsertPostgresArrayTypesBatchArgs }; public async Task InsertPostgresArrayTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresArrayTypesBatchSql)) { foreach (var row in args) @@ -1659,8 +1703,6 @@ public async Task InsertPostgresArrayTypesBatchAsync(List GetPostgresArrayTypesCntAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresArrayTypesCntSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresArrayTypesCntSql, transaction: this.Transaction); } @@ -1712,12 +1754,14 @@ public async Task TruncatePostgresArrayTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncatePostgresArrayTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncatePostgresArrayTypesSql, transaction: this.Transaction); } @@ -1755,12 +1799,14 @@ public async Task InsertPostgresGeoTypesAsync(InsertPostgresGeoTypesArgs args) queryParams.Add("c_circle", args.CCircle); if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(InsertPostgresGeoTypesSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(InsertPostgresGeoTypesSql, queryParams, transaction: this.Transaction); } @@ -1778,9 +1824,8 @@ public class InsertPostgresGeoTypesBatchArgs }; public async Task InsertPostgresGeoTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresGeoTypesBatchSql)) { foreach (var row in args) @@ -1797,8 +1842,6 @@ public async Task InsertPostgresGeoTypesBatchAsync(List GetPostgresGeoTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { var result = await connection.QueryFirstOrDefaultAsync(GetPostgresGeoTypesSql); return result; } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetPostgresGeoTypesSql, transaction: this.Transaction); } @@ -1834,12 +1877,14 @@ public async Task TruncatePostgresGeoTypesAsync() { if (this.Transaction == null) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) + { await connection.ExecuteAsync(TruncatePostgresGeoTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(TruncatePostgresGeoTypesSql, transaction: this.Transaction); } diff --git a/examples/NpgsqlExample/QuerySql.cs b/examples/NpgsqlExample/QuerySql.cs index 4c8154bb..29011982 100644 --- a/examples/NpgsqlExample/QuerySql.cs +++ b/examples/NpgsqlExample/QuerySql.cs @@ -14,11 +14,12 @@ using System.Net; using System.Net.NetworkInformation; using System.Text.Json; +using System.Threading; using System.Threading.Tasks; using System.Xml; namespace NpgsqlExampleGen; -public class QuerySql +public class QuerySql : IDisposable { public QuerySql() { @@ -27,6 +28,7 @@ public QuerySql() public QuerySql(string connectionString) : this() { this.ConnectionString = connectionString; + _dataSource = new Lazy(() => NpgsqlDataSource.Create(connectionString!), LazyThreadSafetyMode.ExecutionAndPublication); } private QuerySql(NpgsqlTransaction transaction) : this() @@ -42,6 +44,21 @@ public static QuerySql WithTransaction(NpgsqlTransaction transaction) private NpgsqlTransaction? Transaction { get; } private string? ConnectionString { get; } + private readonly Lazy? _dataSource; + private NpgsqlDataSource GetDataSource() + { + if (_dataSource == null) + throw new InvalidOperationException("ConnectionString is required when not using a transaction"); + return _dataSource.Value; + } + + public void Dispose() + { + GC.SuppressFinalize(this); + if (_dataSource?.IsValueCreated == true) + _dataSource.Value.Dispose(); + } + private const string GetAuthorSql = @"SELECT id, name, bio FROM authors WHERE name = @name LIMIT 1"; public readonly record struct GetAuthorRow(long Id, string Name, string? Bio); @@ -50,10 +67,11 @@ public static QuerySql WithTransaction(NpgsqlTransaction transaction) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorSql; command.Parameters.AddWithValue("@name", args.Name); using (var reader = await command.ExecuteReaderAsync()) { @@ -68,12 +86,11 @@ public static QuerySql WithTransaction(NpgsqlTransaction transaction) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -108,10 +125,11 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(ListAuthorsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = ListAuthorsSql; command.Parameters.AddWithValue("@offset", args.Offset); command.Parameters.AddWithValue("@limit", args.Limit); using (var reader = await command.ExecuteReaderAsync()) @@ -125,7 +143,7 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -150,10 +168,11 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(CreateAuthorSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateAuthorSql; command.Parameters.AddWithValue("@id", args.Id); command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); @@ -170,12 +189,11 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -208,10 +226,11 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(CreateAuthorReturnIdSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateAuthorReturnIdSql; command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); var result = await command.ExecuteScalarAsync(); @@ -220,7 +239,7 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -241,10 +260,11 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorByIdSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorByIdSql; command.Parameters.AddWithValue("@id", args.Id); using (var reader = await command.ExecuteReaderAsync()) { @@ -259,12 +279,11 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -296,10 +315,11 @@ public async Task> GetAuthorByNamePatternAsync(G { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorByNamePatternSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorByNamePatternSql; command.Parameters.AddWithValue("@name_pattern", args.NamePattern ?? (object)DBNull.Value); using (var reader = await command.ExecuteReaderAsync()) { @@ -312,7 +332,7 @@ public async Task> GetAuthorByNamePatternAsync(G } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -336,19 +356,20 @@ public async Task DeleteAuthorAsync(DeleteAuthorArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(DeleteAuthorSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = DeleteAuthorSql; command.Parameters.AddWithValue("@name", args.Name); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -364,18 +385,19 @@ public async Task TruncateAuthorsAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(TruncateAuthorsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncateAuthorsSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -393,17 +415,18 @@ public async Task UpdateAuthorsAsync(UpdateAuthorsArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(UpdateAuthorsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = UpdateAuthorsSql; command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); return await command.ExecuteNonQueryAsync(); } } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -422,10 +445,11 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorsByIdsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorsByIdsSql; command.Parameters.AddWithValue("@longArr_1", args.LongArr1); using (var reader = await command.ExecuteReaderAsync()) { @@ -438,7 +462,7 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -464,10 +488,11 @@ public async Task> GetAuthorsByIdsAndNamesAsync { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorsByIdsAndNamesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorsByIdsAndNamesSql; command.Parameters.AddWithValue("@longArr_1", args.LongArr1); command.Parameters.AddWithValue("@stringArr_2", args.StringArr2); using (var reader = await command.ExecuteReaderAsync()) @@ -481,7 +506,7 @@ public async Task> GetAuthorsByIdsAndNamesAsync } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -506,10 +531,11 @@ public async Task CreateBookAsync(CreateBookArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(CreateBookSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateBookSql; command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@author_id", args.AuthorId); var result = await command.ExecuteScalarAsync(); @@ -518,7 +544,7 @@ public async Task CreateBookAsync(CreateBookArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -542,10 +568,11 @@ public async Task> ListAllAuthorsBooksAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(ListAllAuthorsBooksSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = ListAllAuthorsBooksSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -557,7 +584,7 @@ public async Task> ListAllAuthorsBooksAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -584,10 +611,11 @@ public async Task> GetDuplicateAuthorsAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetDuplicateAuthorsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetDuplicateAuthorsSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -599,7 +627,7 @@ public async Task> GetDuplicateAuthorsAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -626,10 +654,11 @@ public async Task> GetAuthorsByBookNameAsync(GetAu { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorsByBookNameSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorsByBookNameSql; command.Parameters.AddWithValue("@name", args.Name); using (var reader = await command.ExecuteReaderAsync()) { @@ -642,7 +671,7 @@ public async Task> GetAuthorsByBookNameAsync(GetAu } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -665,21 +694,22 @@ public async Task CreateExtendedBioAsync(CreateExtendedBioArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(CreateExtendedBioSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateExtendedBioSql; command.Parameters.AddWithValue("@author_name", args.AuthorName); command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@bio_type", args.BioType != null ? args.BioType.Value.Stringify() : (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -699,10 +729,11 @@ public async Task CreateExtendedBioAsync(CreateExtendedBioArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetFirstExtendedBioByTypeSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetFirstExtendedBioByTypeSql; command.Parameters.AddWithValue("@bio_type", args.BioType != null ? args.BioType.Value.Stringify() : (object)DBNull.Value); using (var reader = await command.ExecuteReaderAsync()) { @@ -717,12 +748,11 @@ public async Task CreateExtendedBioAsync(CreateExtendedBioArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -751,18 +781,19 @@ public async Task TruncateExtendedBiosAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(TruncateExtendedBiosSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncateExtendedBiosSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -784,10 +815,11 @@ CROSS JOIN postgres_numeric_types { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresFunctionsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresFunctionsSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -801,12 +833,11 @@ CROSS JOIN postgres_numeric_types } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -849,10 +880,11 @@ public async Task InsertPostgresNumericTypesAsync(InsertPostgresNumericTypesArgs { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(InsertPostgresNumericTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = InsertPostgresNumericTypesSql; command.Parameters.AddWithValue("@c_boolean", args.CBoolean ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_bit", args.CBit ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_smallint", args.CSmallint ?? (object)DBNull.Value); @@ -865,12 +897,12 @@ public async Task InsertPostgresNumericTypesAsync(InsertPostgresNumericTypesArgs command.Parameters.AddWithValue("@c_money", NpgsqlDbType.Money, args.CMoney ?? (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -896,10 +928,11 @@ public async Task InsertPostgresNumericTypesAsync(InsertPostgresNumericTypesArgs { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresNumericTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresNumericTypesSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -920,12 +953,11 @@ public async Task InsertPostgresNumericTypesAsync(InsertPostgresNumericTypesArgs } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -960,18 +992,19 @@ public async Task TruncatePostgresNumericTypesAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(TruncatePostgresNumericTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncatePostgresNumericTypesSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1011,10 +1044,11 @@ GROUP BY { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresNumericTypesCntSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresNumericTypesCntSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -1036,12 +1070,11 @@ GROUP BY } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1076,9 +1109,8 @@ GROUP BY public readonly record struct InsertPostgresNumericTypesBatchArgs(bool? CBoolean, byte[]? CBit, short? CSmallint, int? CInteger, long? CBigint, decimal? CDecimal, decimal? CNumeric, float? CReal, double? CDoublePrecision, decimal? CMoney); public async Task InsertPostgresNumericTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresNumericTypesBatchSql)) { foreach (var row in args) @@ -1098,8 +1130,6 @@ public async Task InsertPostgresNumericTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresStringTypesBatchSql)) { foreach (var row in args) @@ -1170,8 +1200,6 @@ public async Task InsertPostgresStringTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresDateTimeTypesBatchSql)) { foreach (var row in args) @@ -1630,8 +1660,6 @@ public async Task InsertPostgresDateTimeTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresNetworkTypesBatchSql)) { foreach (var row in args) @@ -1849,8 +1878,6 @@ public async Task InsertPostgresNetworkTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresSpecialTypesBatchSql)) { foreach (var row in args) @@ -2155,8 +2185,6 @@ public async Task InsertPostgresSpecialTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresArrayTypesBatchSql)) { foreach (var row in args) @@ -2365,8 +2393,6 @@ public async Task InsertPostgresArrayTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresGeoTypesBatchSql)) { foreach (var row in args) @@ -2545,8 +2572,6 @@ public async Task InsertPostgresGeoTypesBatchAsync(List(() => NpgsqlDataSource.Create(connectionString), LazyThreadSafetyMode.ExecutionAndPublication); } private QuerySql(NpgsqlTransaction transaction) : this() @@ -43,6 +45,21 @@ public static QuerySql WithTransaction(NpgsqlTransaction transaction) private NpgsqlTransaction Transaction { get; } private string ConnectionString { get; } + private readonly Lazy _dataSource; + private NpgsqlDataSource GetDataSource() + { + if (_dataSource == null) + throw new InvalidOperationException("ConnectionString is required when not using a transaction"); + return _dataSource.Value; + } + + public void Dispose() + { + GC.SuppressFinalize(this); + if (_dataSource?.IsValueCreated == true) + _dataSource.Value.Dispose(); + } + private const string GetAuthorSql = @"SELECT id, name, bio FROM authors WHERE name = @name LIMIT 1"; public class GetAuthorRow @@ -59,10 +76,11 @@ public async Task GetAuthorAsync(GetAuthorArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorSql; command.Parameters.AddWithValue("@name", args.Name); using (var reader = await command.ExecuteReaderAsync()) { @@ -77,12 +95,11 @@ public async Task GetAuthorAsync(GetAuthorArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -126,10 +143,11 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(ListAuthorsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = ListAuthorsSql; command.Parameters.AddWithValue("@offset", args.Offset); command.Parameters.AddWithValue("@limit", args.Limit); using (var reader = await command.ExecuteReaderAsync()) @@ -143,7 +161,7 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -178,10 +196,11 @@ public async Task CreateAuthorAsync(CreateAuthorArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(CreateAuthorSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateAuthorSql; command.Parameters.AddWithValue("@id", args.Id); command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); @@ -198,12 +217,11 @@ public async Task CreateAuthorAsync(CreateAuthorArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -243,10 +261,11 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(CreateAuthorReturnIdSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateAuthorReturnIdSql; command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); var result = await command.ExecuteScalarAsync(); @@ -255,7 +274,7 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -284,10 +303,11 @@ public async Task GetAuthorByIdAsync(GetAuthorByIdArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorByIdSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorByIdSql; command.Parameters.AddWithValue("@id", args.Id); using (var reader = await command.ExecuteReaderAsync()) { @@ -302,12 +322,11 @@ public async Task GetAuthorByIdAsync(GetAuthorByIdArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -347,10 +366,11 @@ public async Task> GetAuthorByNamePatternAsync(G { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorByNamePatternSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorByNamePatternSql; command.Parameters.AddWithValue("@name_pattern", args.NamePattern ?? (object)DBNull.Value); using (var reader = await command.ExecuteReaderAsync()) { @@ -363,7 +383,7 @@ public async Task> GetAuthorByNamePatternAsync(G } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -390,19 +410,20 @@ public async Task DeleteAuthorAsync(DeleteAuthorArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(DeleteAuthorSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = DeleteAuthorSql; command.Parameters.AddWithValue("@name", args.Name); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -418,18 +439,19 @@ public async Task TruncateAuthorsAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(TruncateAuthorsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncateAuthorsSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -450,17 +472,18 @@ public async Task UpdateAuthorsAsync(UpdateAuthorsArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(UpdateAuthorsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = UpdateAuthorsSql; command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); return await command.ExecuteNonQueryAsync(); } } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -487,10 +510,11 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorsByIdsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorsByIdsSql; command.Parameters.AddWithValue("@longArr_1", args.LongArr1); using (var reader = await command.ExecuteReaderAsync()) { @@ -503,7 +527,7 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -538,10 +562,11 @@ public async Task> GetAuthorsByIdsAndNamesAsync { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorsByIdsAndNamesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorsByIdsAndNamesSql; command.Parameters.AddWithValue("@longArr_1", args.LongArr1); command.Parameters.AddWithValue("@stringArr_2", args.StringArr2); using (var reader = await command.ExecuteReaderAsync()) @@ -555,7 +580,7 @@ public async Task> GetAuthorsByIdsAndNamesAsync } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -587,10 +612,11 @@ public async Task CreateBookAsync(CreateBookArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(CreateBookSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateBookSql; command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@author_id", args.AuthorId); var result = await command.ExecuteScalarAsync(); @@ -599,7 +625,7 @@ public async Task CreateBookAsync(CreateBookArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -627,10 +653,11 @@ public async Task> ListAllAuthorsBooksAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(ListAllAuthorsBooksSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = ListAllAuthorsBooksSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -642,7 +669,7 @@ public async Task> ListAllAuthorsBooksAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -673,10 +700,11 @@ public async Task> GetDuplicateAuthorsAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetDuplicateAuthorsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetDuplicateAuthorsSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -688,7 +716,7 @@ public async Task> GetDuplicateAuthorsAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -724,10 +752,11 @@ public async Task> GetAuthorsByBookNameAsync(GetAu { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorsByBookNameSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorsByBookNameSql; command.Parameters.AddWithValue("@name", args.Name); using (var reader = await command.ExecuteReaderAsync()) { @@ -740,7 +769,7 @@ public async Task> GetAuthorsByBookNameAsync(GetAu } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -768,21 +797,22 @@ public async Task CreateExtendedBioAsync(CreateExtendedBioArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(CreateExtendedBioSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateExtendedBioSql; command.Parameters.AddWithValue("@author_name", args.AuthorName); command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@bio_type", args.BioType != null ? args.BioType.Value.Stringify() : (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -810,10 +840,11 @@ public async Task GetFirstExtendedBioByTypeAsync(G { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetFirstExtendedBioByTypeSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetFirstExtendedBioByTypeSql; command.Parameters.AddWithValue("@bio_type", args.BioType != null ? args.BioType.Value.Stringify() : (object)DBNull.Value); using (var reader = await command.ExecuteReaderAsync()) { @@ -828,12 +859,11 @@ public async Task GetFirstExtendedBioByTypeAsync(G } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -862,18 +892,19 @@ public async Task TruncateExtendedBiosAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(TruncateExtendedBiosSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncateExtendedBiosSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -900,10 +931,11 @@ public async Task GetPostgresFunctionsAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresFunctionsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresFunctionsSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -917,12 +949,11 @@ public async Task GetPostgresFunctionsAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -977,10 +1008,11 @@ public async Task InsertPostgresNumericTypesAsync(InsertPostgresNumericTypesArgs { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(InsertPostgresNumericTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = InsertPostgresNumericTypesSql; command.Parameters.AddWithValue("@c_boolean", args.CBoolean ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_bit", args.CBit ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_smallint", args.CSmallint ?? (object)DBNull.Value); @@ -993,12 +1025,12 @@ public async Task InsertPostgresNumericTypesAsync(InsertPostgresNumericTypesArgs command.Parameters.AddWithValue("@c_money", NpgsqlDbType.Money, args.CMoney ?? (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1036,10 +1068,11 @@ public async Task GetPostgresNumericTypesAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresNumericTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresNumericTypesSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -1060,12 +1093,11 @@ public async Task GetPostgresNumericTypesAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1100,18 +1132,19 @@ public async Task TruncatePostgresNumericTypesAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(TruncatePostgresNumericTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncatePostgresNumericTypesSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1164,10 +1197,11 @@ public async Task GetPostgresNumericTypesCntAsync { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresNumericTypesCntSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresNumericTypesCntSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -1189,12 +1223,11 @@ public async Task GetPostgresNumericTypesCntAsync } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1241,9 +1274,8 @@ public class InsertPostgresNumericTypesBatchArgs }; public async Task InsertPostgresNumericTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresNumericTypesBatchSql)) { foreach (var row in args) @@ -1263,8 +1295,6 @@ public async Task InsertPostgresNumericTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresStringTypesBatchSql)) { foreach (var row in args) @@ -1349,8 +1379,6 @@ public async Task InsertPostgresStringTypesBatchAsync(List GetPostgresStringTypesAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresStringTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresStringTypesSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -1386,12 +1415,11 @@ public async Task GetPostgresStringTypesAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1421,18 +1449,19 @@ public async Task TruncatePostgresStringTypesAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(TruncatePostgresStringTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncatePostgresStringTypesSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1470,10 +1499,11 @@ public async Task GetPostgresStringTypesCntAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresStringTypesCntSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresStringTypesCntSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -1490,12 +1520,11 @@ public async Task GetPostgresStringTypesCntAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1549,10 +1578,11 @@ public async Task GetPostgresStringTypesTex { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresStringTypesTextSearchSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresStringTypesTextSearchSql; command.Parameters.AddWithValue("@to_tsquery", args.ToTsquery); using (var reader = await command.ExecuteReaderAsync()) { @@ -1568,12 +1598,11 @@ public async Task GetPostgresStringTypesTex } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1621,10 +1650,11 @@ public async Task InsertPostgresDateTimeTypesAsync(InsertPostgresDateTimeTypesAr { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(InsertPostgresDateTimeTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = InsertPostgresDateTimeTypesSql; command.Parameters.AddWithValue("@c_date", NpgsqlDbType.Date, args.CDate ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_time", NpgsqlDbType.Time, args.CTime ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_timestamp", NpgsqlDbType.Timestamp, args.CTimestamp ?? (object)DBNull.Value); @@ -1633,12 +1663,12 @@ public async Task InsertPostgresDateTimeTypesAsync(InsertPostgresDateTimeTypesAr command.Parameters.AddWithValue("@c_timestamp_noda_instant_override", NpgsqlDbType.Timestamp, args.CTimestampNodaInstantOverride is null ? (object)DBNull.Value : (DateTime? )DateTime.SpecifyKind(args.CTimestampNodaInstantOverride.Value.ToDateTimeUtc(), DateTimeKind.Unspecified)); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1668,10 +1698,11 @@ public async Task GetPostgresDateTimeTypesAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresDateTimeTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresDateTimeTypesSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -1694,12 +1725,11 @@ public async Task GetPostgresDateTimeTypesAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1736,18 +1766,19 @@ public async Task TruncatePostgresDateTimeTypesAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(TruncatePostgresDateTimeTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncatePostgresDateTimeTypesSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1785,10 +1816,11 @@ public async Task GetPostgresDateTimeTypesCntAsy { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresDateTimeTypesCntSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresDateTimeTypesCntSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -1805,12 +1837,11 @@ public async Task GetPostgresDateTimeTypesCntAsy } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1847,9 +1878,8 @@ public class InsertPostgresDateTimeTypesBatchArgs }; public async Task InsertPostgresDateTimeTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresDateTimeTypesBatchSql)) { foreach (var row in args) @@ -1864,8 +1894,6 @@ public async Task InsertPostgresDateTimeTypesBatchAsync(List GetPostgresNetworkTypesAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresNetworkTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresNetworkTypesSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -1958,12 +1988,11 @@ public async Task GetPostgresNetworkTypesAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1992,18 +2021,19 @@ public async Task TruncatePostgresNetworkTypesAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(TruncatePostgresNetworkTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncatePostgresNetworkTypesSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -2035,10 +2065,11 @@ public async Task GetPostgresNetworkTypesCntAsync { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresNetworkTypesCntSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresNetworkTypesCntSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -2053,12 +2084,11 @@ public async Task GetPostgresNetworkTypesCntAsync } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -2091,9 +2121,8 @@ public class InsertPostgresNetworkTypesBatchArgs }; public async Task InsertPostgresNetworkTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresNetworkTypesBatchSql)) { foreach (var row in args) @@ -2106,8 +2135,6 @@ public async Task InsertPostgresNetworkTypesBatchAsync(List GetPostgresNotNullTypesAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresNotNullTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresNotNullTypesSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -2250,12 +2280,11 @@ public async Task GetPostgresNotNullTypesAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -2281,18 +2310,19 @@ public async Task TruncatePostgresNotNullTypesAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(TruncatePostgresNotNullTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncatePostgresNotNullTypesSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -2328,10 +2358,11 @@ public async Task GetPostgresSpecialTypesAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresSpecialTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresSpecialTypesSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -2355,12 +2386,11 @@ public async Task GetPostgresSpecialTypesAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -2398,18 +2428,19 @@ public async Task TruncatePostgresSpecialTypesAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(TruncatePostgresSpecialTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncatePostgresSpecialTypesSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -2428,9 +2459,8 @@ public class InsertPostgresSpecialTypesBatchArgs }; public async Task InsertPostgresSpecialTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresSpecialTypesBatchSql)) { foreach (var row in args) @@ -2443,8 +2473,6 @@ public async Task InsertPostgresSpecialTypesBatchAsync(List GetPostgresSpecialTypesCntAsync { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresSpecialTypesCntSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresSpecialTypesCntSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -2497,12 +2526,11 @@ public async Task GetPostgresSpecialTypesCntAsync } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -2552,10 +2580,11 @@ public async Task InsertPostgresArrayTypesAsync(InsertPostgresArrayTypesArgs arg { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(InsertPostgresArrayTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = InsertPostgresArrayTypesSql; command.Parameters.AddWithValue("@c_bytea", args.CBytea ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_boolean_array", args.CBooleanArray ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_text_array", args.CTextArray ?? (object)DBNull.Value); @@ -2565,12 +2594,12 @@ public async Task InsertPostgresArrayTypesAsync(InsertPostgresArrayTypesArgs arg command.Parameters.AddWithValue("@c_timestamp_array", args.CTimestampArray ?? (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -2602,10 +2631,11 @@ public async Task GetPostgresArrayTypesAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresArrayTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresArrayTypesSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -2623,12 +2653,11 @@ public async Task GetPostgresArrayTypesAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -2667,9 +2696,8 @@ public class InsertPostgresArrayTypesBatchArgs }; public async Task InsertPostgresArrayTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresArrayTypesBatchSql)) { foreach (var row in args) @@ -2685,8 +2713,6 @@ public async Task InsertPostgresArrayTypesBatchAsync(List GetPostgresArrayTypesCntAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresArrayTypesCntSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresArrayTypesCntSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -2742,12 +2769,11 @@ public async Task GetPostgresArrayTypesCntAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -2779,18 +2805,19 @@ public async Task TruncatePostgresArrayTypesAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(TruncatePostgresArrayTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncatePostgresArrayTypesSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -2825,10 +2852,11 @@ public async Task InsertPostgresGeoTypesAsync(InsertPostgresGeoTypesArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(InsertPostgresGeoTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = InsertPostgresGeoTypesSql; command.Parameters.AddWithValue("@c_point", args.CPoint ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_line", args.CLine ?? (object)DBNull.Value); command.Parameters.AddWithValue("@c_lseg", args.CLseg ?? (object)DBNull.Value); @@ -2838,12 +2866,12 @@ public async Task InsertPostgresGeoTypesAsync(InsertPostgresGeoTypesArgs args) command.Parameters.AddWithValue("@c_circle", args.CCircle ?? (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -2873,9 +2901,8 @@ public class InsertPostgresGeoTypesBatchArgs }; public async Task InsertPostgresGeoTypesBatchAsync(List args) { - using (var connection = new NpgsqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); using (var writer = await connection.BeginBinaryImportAsync(InsertPostgresGeoTypesBatchSql)) { foreach (var row in args) @@ -2892,8 +2919,6 @@ public async Task InsertPostgresGeoTypesBatchAsync(List GetPostgresGeoTypesAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetPostgresGeoTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetPostgresGeoTypesSql; using (var reader = await command.ExecuteReaderAsync()) { if (await reader.ReadAsync()) @@ -2933,12 +2959,11 @@ public async Task GetPostgresGeoTypesAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -2970,18 +2995,19 @@ public async Task TruncatePostgresGeoTypesAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(TruncatePostgresGeoTypesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncatePostgresGeoTypesSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { diff --git a/examples/QuickStartMySqlDalGen/QuerySql.cs b/examples/QuickStartMySqlDalGen/QuerySql.cs index 3dceeec2..e7b6a06e 100644 --- a/examples/QuickStartMySqlDalGen/QuerySql.cs +++ b/examples/QuickStartMySqlDalGen/QuerySql.cs @@ -7,13 +7,15 @@ using MySqlConnector; using System; using System.Collections.Generic; +using System.Data; using System.Globalization; using System.IO; using System.Text; +using System.Threading; using System.Threading.Tasks; namespace QuickStartMySqlDalGen; -public class QuerySql +public class QuerySql : IDisposable { public QuerySql() { @@ -22,6 +24,15 @@ public QuerySql() public QuerySql(string connectionString) : this() { this.ConnectionString = connectionString; + _dataSource = new Lazy(() => + { + var builder = new MySqlConnectionStringBuilder(connectionString!); + builder.ConnectionReset = true; + // Pre-warm connection pool with minimum connections + if (builder.MinimumPoolSize == 0) + builder.MinimumPoolSize = 1; + return new MySqlDataSourceBuilder(builder.ConnectionString).Build(); + }, LazyThreadSafetyMode.ExecutionAndPublication); } private QuerySql(MySqlTransaction transaction) : this() @@ -37,6 +48,21 @@ public static QuerySql WithTransaction(MySqlTransaction transaction) private MySqlTransaction? Transaction { get; } private string? ConnectionString { get; } + private readonly Lazy? _dataSource; + private MySqlDataSource GetDataSource() + { + if (_dataSource == null) + throw new InvalidOperationException("ConnectionString is required when not using a transaction"); + return _dataSource.Value; + } + + public void Dispose() + { + GC.SuppressFinalize(this); + if (_dataSource?.IsValueCreated == true) + _dataSource.Value.Dispose(); + } + private const string GetAuthorSql = "SELECT id, name, bio FROM authors WHERE name = @name LIMIT 1"; public readonly record struct GetAuthorRow(long Id, string Name, string? Bio); public readonly record struct GetAuthorArgs(string Name); @@ -44,11 +70,11 @@ public static QuerySql WithTransaction(MySqlTransaction transaction) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetAuthorSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorSql; command.Parameters.AddWithValue("@name", args.Name); using (var reader = await command.ExecuteReaderAsync()) { @@ -63,12 +89,11 @@ public static QuerySql WithTransaction(MySqlTransaction transaction) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -102,11 +127,11 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(ListAuthorsSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = ListAuthorsSql; command.Parameters.AddWithValue("@limit", args.Limit); command.Parameters.AddWithValue("@offset", args.Offset); using (var reader = await command.ExecuteReaderAsync()) @@ -120,7 +145,7 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -144,22 +169,22 @@ public async Task CreateAuthorAsync(CreateAuthorArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(CreateAuthorSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateAuthorSql; command.Parameters.AddWithValue("@id", args.Id); command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -172,26 +197,26 @@ public async Task CreateAuthorAsync(CreateAuthorArgs args) } } - private const string CreateAuthorReturnIdSql = "INSERT INTO authors (name, bio) VALUES (@name, @bio)"; + private const string CreateAuthorReturnIdSql = "INSERT INTO authors (name, bio) VALUES (@name, @bio); SELECT LAST_INSERT_ID()"; public readonly record struct CreateAuthorReturnIdArgs(string Name, string? Bio); public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(CreateAuthorReturnIdSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateAuthorReturnIdSql; command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); - await command.ExecuteNonQueryAsync(); - return command.LastInsertedId; + var result = await command.ExecuteScalarAsync(); + return Convert.ToInt64(result); } } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -199,8 +224,8 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) command.Transaction = this.Transaction; command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); - await command.ExecuteNonQueryAsync(); - return command.LastInsertedId; + var result = await command.ExecuteScalarAsync(); + return Convert.ToInt64(result); } } @@ -211,11 +236,11 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetAuthorByIdSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorByIdSql; command.Parameters.AddWithValue("@id", args.Id); using (var reader = await command.ExecuteReaderAsync()) { @@ -230,12 +255,11 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -267,11 +291,11 @@ public async Task> GetAuthorByNamePatternAsync(G { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetAuthorByNamePatternSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorByNamePatternSql; command.Parameters.AddWithValue("@name_pattern", args.NamePattern ?? (object)DBNull.Value); using (var reader = await command.ExecuteReaderAsync()) { @@ -284,7 +308,7 @@ public async Task> GetAuthorByNamePatternAsync(G } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -308,20 +332,20 @@ public async Task DeleteAuthorAsync(DeleteAuthorArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(DeleteAuthorSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = DeleteAuthorSql; command.Parameters.AddWithValue("@name", args.Name); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -337,19 +361,19 @@ public async Task DeleteAllAuthorsAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(DeleteAllAuthorsSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = DeleteAllAuthorsSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -367,18 +391,18 @@ public async Task UpdateAuthorsAsync(UpdateAuthorsArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(UpdateAuthorsSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = UpdateAuthorsSql; command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); return await command.ExecuteNonQueryAsync(); } } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -398,11 +422,11 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds transformedSql = Utils.TransformQueryForSliceArgs(transformedSql, args.Ids.Length, "ids"); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(transformedSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = transformedSql; for (int i = 0; i < args.Ids.Length; i++) command.Parameters.AddWithValue($"@idsArg{i}", args.Ids[i]); using (var reader = await command.ExecuteReaderAsync()) @@ -416,7 +440,7 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -444,11 +468,11 @@ public async Task> GetAuthorsByIdsAndNamesAsync transformedSql = Utils.TransformQueryForSliceArgs(transformedSql, args.Names.Length, "names"); if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(transformedSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = transformedSql; for (int i = 0; i < args.Ids.Length; i++) command.Parameters.AddWithValue($"@idsArg{i}", args.Ids[i]); for (int i = 0; i < args.Names.Length; i++) @@ -464,7 +488,7 @@ public async Task> GetAuthorsByIdsAndNamesAsync } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -484,26 +508,26 @@ public async Task> GetAuthorsByIdsAndNamesAsync } } - private const string CreateBookSql = "INSERT INTO books (name, author_id) VALUES (@name, @author_id)"; + private const string CreateBookSql = "INSERT INTO books (name, author_id) VALUES (@name, @author_id); SELECT LAST_INSERT_ID()"; public readonly record struct CreateBookArgs(string Name, long AuthorId); public async Task CreateBookAsync(CreateBookArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(CreateBookSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateBookSql; command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@author_id", args.AuthorId); - await command.ExecuteNonQueryAsync(); - return command.LastInsertedId; + var result = await command.ExecuteScalarAsync(); + return Convert.ToInt64(result); } } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -511,8 +535,8 @@ public async Task CreateBookAsync(CreateBookArgs args) command.Transaction = this.Transaction; command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@author_id", args.AuthorId); - await command.ExecuteNonQueryAsync(); - return command.LastInsertedId; + var result = await command.ExecuteScalarAsync(); + return Convert.ToInt64(result); } } @@ -524,11 +548,11 @@ public async Task> ListAllAuthorsBooksAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(ListAllAuthorsBooksSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = ListAllAuthorsBooksSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -540,7 +564,7 @@ public async Task> ListAllAuthorsBooksAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -564,11 +588,11 @@ public async Task> GetDuplicateAuthorsAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetDuplicateAuthorsSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetDuplicateAuthorsSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -580,7 +604,7 @@ public async Task> GetDuplicateAuthorsAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -605,11 +629,11 @@ public async Task> GetAuthorsByBookNameAsync(GetAu { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetAuthorsByBookNameSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorsByBookNameSql; command.Parameters.AddWithValue("@name", args.Name); using (var reader = await command.ExecuteReaderAsync()) { @@ -622,7 +646,7 @@ public async Task> GetAuthorsByBookNameAsync(GetAu } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -645,23 +669,23 @@ public async Task CreateExtendedBioAsync(CreateExtendedBioArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(CreateExtendedBioSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateExtendedBioSql; command.Parameters.AddWithValue("@author_name", args.AuthorName ?? (object)DBNull.Value); command.Parameters.AddWithValue("@name", args.Name ?? (object)DBNull.Value); command.Parameters.AddWithValue("@bio_type", args.BioType ?? (object)DBNull.Value); command.Parameters.AddWithValue("@author_type", args.AuthorType != null ? string.Join(",", args.AuthorType) : (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -682,11 +706,11 @@ public async Task CreateExtendedBioAsync(CreateExtendedBioArgs args) { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(GetFirstExtendedBioByTypeSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetFirstExtendedBioByTypeSql; command.Parameters.AddWithValue("@bio_type", args.BioType ?? (object)DBNull.Value); using (var reader = await command.ExecuteReaderAsync()) { @@ -702,12 +726,11 @@ public async Task CreateExtendedBioAsync(CreateExtendedBioArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -737,19 +760,19 @@ public async Task TruncateExtendedBiosAsync() { if (this.Transaction == null) { - using (var connection = new MySqlConnection(ConnectionString)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - await connection.OpenAsync(); - using (var command = new MySqlCommand(TruncateExtendedBiosSql, connection)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncateExtendedBiosSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { diff --git a/examples/QuickStartPostgresDalGen/QuerySql.cs b/examples/QuickStartPostgresDalGen/QuerySql.cs index c18a423c..f2ffff62 100644 --- a/examples/QuickStartPostgresDalGen/QuerySql.cs +++ b/examples/QuickStartPostgresDalGen/QuerySql.cs @@ -8,10 +8,11 @@ using System; using System.Collections.Generic; using System.Data; +using System.Threading; using System.Threading.Tasks; namespace QuickStartPostgresDalGen; -public class QuerySql +public class QuerySql : IDisposable { public QuerySql() { @@ -20,6 +21,7 @@ public QuerySql() public QuerySql(string connectionString) : this() { this.ConnectionString = connectionString; + _dataSource = new Lazy(() => NpgsqlDataSource.Create(connectionString!), LazyThreadSafetyMode.ExecutionAndPublication); } private QuerySql(NpgsqlTransaction transaction) : this() @@ -35,6 +37,21 @@ public static QuerySql WithTransaction(NpgsqlTransaction transaction) private NpgsqlTransaction? Transaction { get; } private string? ConnectionString { get; } + private readonly Lazy? _dataSource; + private NpgsqlDataSource GetDataSource() + { + if (_dataSource == null) + throw new InvalidOperationException("ConnectionString is required when not using a transaction"); + return _dataSource.Value; + } + + public void Dispose() + { + GC.SuppressFinalize(this); + if (_dataSource?.IsValueCreated == true) + _dataSource.Value.Dispose(); + } + private const string GetAuthorSql = @"SELECT id, name, bio FROM authors WHERE name = @name LIMIT 1"; public readonly record struct GetAuthorRow(long Id, string Name, string? Bio); @@ -43,10 +60,11 @@ public static QuerySql WithTransaction(NpgsqlTransaction transaction) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorSql; command.Parameters.AddWithValue("@name", args.Name); using (var reader = await command.ExecuteReaderAsync()) { @@ -61,12 +79,11 @@ public static QuerySql WithTransaction(NpgsqlTransaction transaction) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -101,10 +118,11 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(ListAuthorsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = ListAuthorsSql; command.Parameters.AddWithValue("@offset", args.Offset); command.Parameters.AddWithValue("@limit", args.Limit); using (var reader = await command.ExecuteReaderAsync()) @@ -118,7 +136,7 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -143,10 +161,11 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(CreateAuthorSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateAuthorSql; command.Parameters.AddWithValue("@id", args.Id); command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); @@ -163,12 +182,11 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -201,10 +219,11 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(CreateAuthorReturnIdSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateAuthorReturnIdSql; command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); var result = await command.ExecuteScalarAsync(); @@ -213,7 +232,7 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -234,10 +253,11 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorByIdSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorByIdSql; command.Parameters.AddWithValue("@id", args.Id); using (var reader = await command.ExecuteReaderAsync()) { @@ -252,12 +272,11 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -289,10 +308,11 @@ public async Task> GetAuthorByNamePatternAsync(G { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorByNamePatternSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorByNamePatternSql; command.Parameters.AddWithValue("@name_pattern", args.NamePattern ?? (object)DBNull.Value); using (var reader = await command.ExecuteReaderAsync()) { @@ -305,7 +325,7 @@ public async Task> GetAuthorByNamePatternAsync(G } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -329,19 +349,20 @@ public async Task DeleteAuthorAsync(DeleteAuthorArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(DeleteAuthorSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = DeleteAuthorSql; command.Parameters.AddWithValue("@name", args.Name); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -357,18 +378,19 @@ public async Task TruncateAuthorsAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(TruncateAuthorsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncateAuthorsSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -386,17 +408,18 @@ public async Task UpdateAuthorsAsync(UpdateAuthorsArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(UpdateAuthorsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = UpdateAuthorsSql; command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); return await command.ExecuteNonQueryAsync(); } } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -415,10 +438,11 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorsByIdsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorsByIdsSql; command.Parameters.AddWithValue("@longArr_1", args.LongArr1); using (var reader = await command.ExecuteReaderAsync()) { @@ -431,7 +455,7 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -457,10 +481,11 @@ public async Task> GetAuthorsByIdsAndNamesAsync { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorsByIdsAndNamesSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorsByIdsAndNamesSql; command.Parameters.AddWithValue("@longArr_1", args.LongArr1); command.Parameters.AddWithValue("@stringArr_2", args.StringArr2); using (var reader = await command.ExecuteReaderAsync()) @@ -474,7 +499,7 @@ public async Task> GetAuthorsByIdsAndNamesAsync } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -499,10 +524,11 @@ public async Task CreateBookAsync(CreateBookArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(CreateBookSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateBookSql; command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@author_id", args.AuthorId); var result = await command.ExecuteScalarAsync(); @@ -511,7 +537,7 @@ public async Task CreateBookAsync(CreateBookArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -535,10 +561,11 @@ public async Task> ListAllAuthorsBooksAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(ListAllAuthorsBooksSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = ListAllAuthorsBooksSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -550,7 +577,7 @@ public async Task> ListAllAuthorsBooksAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -577,10 +604,11 @@ public async Task> GetDuplicateAuthorsAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetDuplicateAuthorsSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetDuplicateAuthorsSql; using (var reader = await command.ExecuteReaderAsync()) { var result = new List(); @@ -592,7 +620,7 @@ public async Task> GetDuplicateAuthorsAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -619,10 +647,11 @@ public async Task> GetAuthorsByBookNameAsync(GetAu { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetAuthorsByBookNameSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetAuthorsByBookNameSql; command.Parameters.AddWithValue("@name", args.Name); using (var reader = await command.ExecuteReaderAsync()) { @@ -635,7 +664,7 @@ public async Task> GetAuthorsByBookNameAsync(GetAu } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -658,21 +687,22 @@ public async Task CreateExtendedBioAsync(CreateExtendedBioArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(CreateExtendedBioSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = CreateExtendedBioSql; command.Parameters.AddWithValue("@author_name", args.AuthorName); command.Parameters.AddWithValue("@name", args.Name); command.Parameters.AddWithValue("@bio_type", args.BioType != null ? args.BioType.Value.Stringify() : (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -692,10 +722,11 @@ public async Task CreateExtendedBioAsync(CreateExtendedBioArgs args) { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(GetFirstExtendedBioByTypeSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = GetFirstExtendedBioByTypeSql; command.Parameters.AddWithValue("@bio_type", args.BioType != null ? args.BioType.Value.Stringify() : (object)DBNull.Value); using (var reader = await command.ExecuteReaderAsync()) { @@ -710,12 +741,11 @@ public async Task CreateExtendedBioAsync(CreateExtendedBioArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -744,18 +774,19 @@ public async Task TruncateExtendedBiosAsync() { if (this.Transaction == null) { - using (var connection = NpgsqlDataSource.Create(ConnectionString!)) + using (var connection = await GetDataSource().OpenConnectionAsync()) { - using (var command = connection.CreateCommand(TruncateExtendedBiosSql)) + using (var command = connection.CreateCommand()) { + command.CommandText = TruncateExtendedBiosSql; await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { diff --git a/examples/QuickStartSqliteDalGen/QuerySql.cs b/examples/QuickStartSqliteDalGen/QuerySql.cs index f3734618..f5d7fb7e 100644 --- a/examples/QuickStartSqliteDalGen/QuerySql.cs +++ b/examples/QuickStartSqliteDalGen/QuerySql.cs @@ -7,6 +7,8 @@ using Microsoft.Data.Sqlite; using System; using System.Collections.Generic; +using System.Data; +using System.Threading; using System.Threading.Tasks; namespace QuickStartSqliteDalGen; @@ -61,12 +63,11 @@ public static QuerySql WithTransaction(SqliteTransaction transaction) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -118,7 +119,7 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -152,12 +153,12 @@ public async Task CreateAuthorAsync(CreateAuthorArgs args) command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -190,7 +191,7 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -230,12 +231,11 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -286,12 +286,11 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -341,7 +340,7 @@ public async Task> GetAuthorByNamePatternAsync(G } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -377,7 +376,7 @@ public async Task UpdateAuthorsAsync(UpdateAuthorsArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -415,7 +414,7 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -463,7 +462,7 @@ public async Task> GetAuthorsByIdsAndNamesAsync } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -498,12 +497,12 @@ public async Task DeleteAuthorAsync(DeleteAuthorArgs args) command.Parameters.AddWithValue("@name", args.Name); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -534,7 +533,7 @@ public async Task CreateBookAsync(CreateBookArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -573,7 +572,7 @@ public async Task> ListAllAuthorsBooksAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -616,7 +615,7 @@ public async Task> GetDuplicateAuthorsAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -660,7 +659,7 @@ public async Task> GetAuthorsByBookNameAsync(GetAu } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -689,12 +688,12 @@ public async Task DeleteAllAuthorsAsync() { await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { diff --git a/examples/SqliteDapperExample/QuerySql.cs b/examples/SqliteDapperExample/QuerySql.cs index 2e2b8d96..7d4c5729 100644 --- a/examples/SqliteDapperExample/QuerySql.cs +++ b/examples/SqliteDapperExample/QuerySql.cs @@ -11,6 +11,8 @@ using NodaTime.Text; using System; using System.Collections.Generic; +using System.Data; +using System.Threading; using System.Threading.Tasks; namespace SqliteDapperExampleGen; @@ -19,7 +21,7 @@ public class QuerySql public QuerySql() { Utils.ConfigureSqlMapper(); - Dapper.DefaultTypeMap.MatchNamesWithUnderscores = true; + DefaultTypeMap.MatchNamesWithUnderscores = true; } public QuerySql(string connectionString) : this() @@ -65,7 +67,7 @@ public class GetAuthorArgs } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetAuthorSql, queryParams, transaction: this.Transaction); } @@ -99,7 +101,7 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(ListAuthorsSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -120,11 +122,13 @@ public async Task CreateAuthorAsync(CreateAuthorArgs args) if (this.Transaction == null) { using (var connection = new SqliteConnection(ConnectionString)) + { await connection.ExecuteAsync(CreateAuthorSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(CreateAuthorSql, queryParams, transaction: this.Transaction); } @@ -147,10 +151,12 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) if (this.Transaction == null) { using (var connection = new SqliteConnection(ConnectionString)) + { return await connection.QuerySingleAsync(CreateAuthorReturnIdSql, queryParams); + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QuerySingleAsync(CreateAuthorReturnIdSql, queryParams, transaction: this.Transaction); } @@ -180,7 +186,7 @@ public class GetAuthorByIdArgs } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetAuthorByIdSql, queryParams, transaction: this.Transaction); } @@ -211,7 +217,7 @@ public class GetAuthorByIdWithMultipleNamedParamArgs } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetAuthorByIdWithMultipleNamedParamSql, queryParams, transaction: this.Transaction); } @@ -241,7 +247,7 @@ public async Task> GetAuthorByNamePatternAsync(G } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(GetAuthorByNamePatternSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -260,10 +266,12 @@ public async Task UpdateAuthorsAsync(UpdateAuthorsArgs args) if (this.Transaction == null) { using (var connection = new SqliteConnection(ConnectionString)) + { return await connection.ExecuteAsync(UpdateAuthorsSql, queryParams); + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.ExecuteAsync(UpdateAuthorsSql, queryParams, transaction: this.Transaction); } @@ -295,7 +303,7 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(transformedSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -331,7 +339,7 @@ public async Task> GetAuthorsByIdsAndNamesAsync } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(transformedSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -349,11 +357,13 @@ public async Task DeleteAuthorAsync(DeleteAuthorArgs args) if (this.Transaction == null) { using (var connection = new SqliteConnection(ConnectionString)) + { await connection.ExecuteAsync(DeleteAuthorSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(DeleteAuthorSql, queryParams, transaction: this.Transaction); } @@ -376,10 +386,12 @@ public async Task CreateBookAsync(CreateBookArgs args) if (this.Transaction == null) { using (var connection = new SqliteConnection(ConnectionString)) + { return await connection.QuerySingleAsync(CreateBookSql, queryParams); + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QuerySingleAsync(CreateBookSql, queryParams, transaction: this.Transaction); } @@ -414,7 +426,7 @@ public async Task> ListAllAuthorsBooksAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -461,7 +473,7 @@ public async Task> GetDuplicateAuthorsAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -514,7 +526,7 @@ public async Task> GetAuthorsByBookNameAsync(GetAu } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -537,11 +549,13 @@ public async Task DeleteAllAuthorsAsync() if (this.Transaction == null) { using (var connection = new SqliteConnection(ConnectionString)) + { await connection.ExecuteAsync(DeleteAllAuthorsSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(DeleteAllAuthorsSql, transaction: this.Transaction); } @@ -589,11 +603,13 @@ public async Task InsertSqliteTypesAsync(InsertSqliteTypesArgs args) if (this.Transaction == null) { using (var connection = new SqliteConnection(ConnectionString)) + { await connection.ExecuteAsync(InsertSqliteTypesSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(InsertSqliteTypesSql, queryParams, transaction: this.Transaction); } @@ -609,8 +625,8 @@ public async Task InsertSqliteTypesBatchAsync(List a { using (var connection = new SqliteConnection(ConnectionString)) { - await connection.OpenAsync(); var transformedSql = Utils.TransformQueryForSqliteBatch(InsertSqliteTypesBatchSql, args.Count); + await connection.OpenAsync(); using (var command = new SqliteCommand(transformedSql, connection)) { for (int i = 0; i < args.Count; i++) @@ -662,7 +678,7 @@ public class GetSqliteTypesRow } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetSqliteTypesSql, transaction: this.Transaction); } @@ -695,7 +711,7 @@ public class GetSqliteTypesCntRow } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetSqliteTypesCntSql, transaction: this.Transaction); } @@ -722,7 +738,7 @@ public class GetSqliteFunctionsRow } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetSqliteFunctionsSql, transaction: this.Transaction); } @@ -733,11 +749,13 @@ public async Task DeleteAllSqliteTypesAsync() if (this.Transaction == null) { using (var connection = new SqliteConnection(ConnectionString)) + { await connection.ExecuteAsync(DeleteAllSqliteTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(DeleteAllSqliteTypesSql, transaction: this.Transaction); } diff --git a/examples/SqliteDapperLegacyExample/QuerySql.cs b/examples/SqliteDapperLegacyExample/QuerySql.cs index 4169d9c1..b18e6346 100644 --- a/examples/SqliteDapperLegacyExample/QuerySql.cs +++ b/examples/SqliteDapperLegacyExample/QuerySql.cs @@ -13,6 +13,8 @@ namespace SqliteDapperLegacyExampleGen using NodaTime.Text; using System; using System.Collections.Generic; + using System.Data; + using System.Threading; using System.Threading.Tasks; public class QuerySql @@ -20,7 +22,7 @@ public class QuerySql public QuerySql() { Utils.ConfigureSqlMapper(); - Dapper.DefaultTypeMap.MatchNamesWithUnderscores = true; + DefaultTypeMap.MatchNamesWithUnderscores = true; } public QuerySql(string connectionString) : this() @@ -66,7 +68,7 @@ public async Task GetAuthorAsync(GetAuthorArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetAuthorSql, queryParams, transaction: this.Transaction); } @@ -100,7 +102,7 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(ListAuthorsSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -121,11 +123,13 @@ public async Task CreateAuthorAsync(CreateAuthorArgs args) if (this.Transaction == null) { using (var connection = new SqliteConnection(ConnectionString)) + { await connection.ExecuteAsync(CreateAuthorSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(CreateAuthorSql, queryParams, transaction: this.Transaction); } @@ -148,10 +152,12 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) if (this.Transaction == null) { using (var connection = new SqliteConnection(ConnectionString)) + { return await connection.QuerySingleAsync(CreateAuthorReturnIdSql, queryParams); + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QuerySingleAsync(CreateAuthorReturnIdSql, queryParams, transaction: this.Transaction); } @@ -181,7 +187,7 @@ public async Task GetAuthorByIdAsync(GetAuthorByIdArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetAuthorByIdSql, queryParams, transaction: this.Transaction); } @@ -212,7 +218,7 @@ public async Task GetAuthorByIdWithMulti } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetAuthorByIdWithMultipleNamedParamSql, queryParams, transaction: this.Transaction); } @@ -242,7 +248,7 @@ public async Task> GetAuthorByNamePatternAsync(G } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(GetAuthorByNamePatternSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -261,10 +267,12 @@ public async Task UpdateAuthorsAsync(UpdateAuthorsArgs args) if (this.Transaction == null) { using (var connection = new SqliteConnection(ConnectionString)) + { return await connection.ExecuteAsync(UpdateAuthorsSql, queryParams); + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.ExecuteAsync(UpdateAuthorsSql, queryParams, transaction: this.Transaction); } @@ -296,7 +304,7 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(transformedSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -332,7 +340,7 @@ public async Task> GetAuthorsByIdsAndNamesAsync } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return (await this.Transaction.Connection.QueryAsync(transformedSql, queryParams, transaction: this.Transaction)).AsList(); } @@ -350,11 +358,13 @@ public async Task DeleteAuthorAsync(DeleteAuthorArgs args) if (this.Transaction == null) { using (var connection = new SqliteConnection(ConnectionString)) + { await connection.ExecuteAsync(DeleteAuthorSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(DeleteAuthorSql, queryParams, transaction: this.Transaction); } @@ -377,10 +387,12 @@ public async Task CreateBookAsync(CreateBookArgs args) if (this.Transaction == null) { using (var connection = new SqliteConnection(ConnectionString)) + { return await connection.QuerySingleAsync(CreateBookSql, queryParams); + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QuerySingleAsync(CreateBookSql, queryParams, transaction: this.Transaction); } @@ -415,7 +427,7 @@ public async Task> ListAllAuthorsBooksAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -462,7 +474,7 @@ public async Task> GetDuplicateAuthorsAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -515,7 +527,7 @@ public async Task> GetAuthorsByBookNameAsync(GetAu } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -538,11 +550,13 @@ public async Task DeleteAllAuthorsAsync() if (this.Transaction == null) { using (var connection = new SqliteConnection(ConnectionString)) + { await connection.ExecuteAsync(DeleteAllAuthorsSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(DeleteAllAuthorsSql, transaction: this.Transaction); } @@ -590,11 +604,13 @@ public async Task InsertSqliteTypesAsync(InsertSqliteTypesArgs args) if (this.Transaction == null) { using (var connection = new SqliteConnection(ConnectionString)) + { await connection.ExecuteAsync(InsertSqliteTypesSql, queryParams); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(InsertSqliteTypesSql, queryParams, transaction: this.Transaction); } @@ -610,8 +626,8 @@ public async Task InsertSqliteTypesBatchAsync(List a { using (var connection = new SqliteConnection(ConnectionString)) { - await connection.OpenAsync(); var transformedSql = Utils.TransformQueryForSqliteBatch(InsertSqliteTypesBatchSql, args.Count); + await connection.OpenAsync(); using (var command = new SqliteCommand(transformedSql, connection)) { for (int i = 0; i < args.Count; i++) @@ -663,7 +679,7 @@ public async Task GetSqliteTypesAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetSqliteTypesSql, transaction: this.Transaction); } @@ -696,7 +712,7 @@ public async Task GetSqliteTypesCntAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetSqliteTypesCntSql, transaction: this.Transaction); } @@ -723,7 +739,7 @@ public async Task GetSqliteFunctionsAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); return await this.Transaction.Connection.QueryFirstOrDefaultAsync(GetSqliteFunctionsSql, transaction: this.Transaction); } @@ -734,11 +750,13 @@ public async Task DeleteAllSqliteTypesAsync() if (this.Transaction == null) { using (var connection = new SqliteConnection(ConnectionString)) + { await connection.ExecuteAsync(DeleteAllSqliteTypesSql); - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); await this.Transaction.Connection.ExecuteAsync(DeleteAllSqliteTypesSql, transaction: this.Transaction); } diff --git a/examples/SqliteExample/QuerySql.cs b/examples/SqliteExample/QuerySql.cs index 3c10bf0b..88e013b6 100644 --- a/examples/SqliteExample/QuerySql.cs +++ b/examples/SqliteExample/QuerySql.cs @@ -10,6 +10,8 @@ using NodaTime.Text; using System; using System.Collections.Generic; +using System.Data; +using System.Threading; using System.Threading.Tasks; namespace SqliteExampleGen; @@ -64,12 +66,11 @@ public static QuerySql WithTransaction(SqliteTransaction transaction) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -121,7 +122,7 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -155,12 +156,12 @@ public async Task CreateAuthorAsync(CreateAuthorArgs args) command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -193,7 +194,7 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -233,12 +234,11 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -289,12 +289,11 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -344,7 +343,7 @@ public async Task> GetAuthorByNamePatternAsync(G } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -380,7 +379,7 @@ public async Task UpdateAuthorsAsync(UpdateAuthorsArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -418,7 +417,7 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -466,7 +465,7 @@ public async Task> GetAuthorsByIdsAndNamesAsync } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -501,12 +500,12 @@ public async Task DeleteAuthorAsync(DeleteAuthorArgs args) command.Parameters.AddWithValue("@name", args.Name); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -537,7 +536,7 @@ public async Task CreateBookAsync(CreateBookArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -576,7 +575,7 @@ public async Task> ListAllAuthorsBooksAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -619,7 +618,7 @@ public async Task> GetDuplicateAuthorsAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -663,7 +662,7 @@ public async Task> GetAuthorsByBookNameAsync(GetAu } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -692,12 +691,12 @@ public async Task DeleteAllAuthorsAsync() { await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -743,12 +742,12 @@ public async Task InsertSqliteTypesAsync(InsertSqliteTypesArgs args) command.Parameters.AddWithValue("@c_integer_bool_override", args.CIntegerBoolOverride != null ? (int? )Convert.ToInt32(args.CIntegerBoolOverride) : (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -774,8 +773,8 @@ public async Task InsertSqliteTypesBatchAsync(List a { using (var connection = new SqliteConnection(ConnectionString)) { - await connection.OpenAsync(); var transformedSql = Utils.TransformQueryForSqliteBatch(InsertSqliteTypesBatchSql, args.Count); + await connection.OpenAsync(); using (var command = new SqliteCommand(transformedSql, connection)) { for (int i = 0; i < args.Count; i++) @@ -833,12 +832,11 @@ FROM types_sqlite } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -902,12 +900,11 @@ FROM types_sqlite } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -960,12 +957,11 @@ FROM types_sqlite } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1000,12 +996,12 @@ public async Task DeleteAllSqliteTypesAsync() { await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { diff --git a/examples/SqliteLegacyExample/QuerySql.cs b/examples/SqliteLegacyExample/QuerySql.cs index af32b735..b85b309b 100644 --- a/examples/SqliteLegacyExample/QuerySql.cs +++ b/examples/SqliteLegacyExample/QuerySql.cs @@ -12,6 +12,8 @@ namespace SqliteLegacyExampleGen using NodaTime.Text; using System; using System.Collections.Generic; + using System.Data; + using System.Threading; using System.Threading.Tasks; public class QuerySql @@ -73,12 +75,11 @@ public async Task GetAuthorAsync(GetAuthorArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -139,7 +140,7 @@ public async Task> ListAuthorsAsync(ListAuthorsArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -178,12 +179,12 @@ public async Task CreateAuthorAsync(CreateAuthorArgs args) command.Parameters.AddWithValue("@bio", args.Bio ?? (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -223,7 +224,7 @@ public async Task CreateAuthorReturnIdAsync(CreateAuthorReturnIdArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -271,12 +272,11 @@ public async Task GetAuthorByIdAsync(GetAuthorByIdArgs args) } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -336,12 +336,11 @@ public async Task GetAuthorByIdWithMulti } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -399,7 +398,7 @@ public async Task> GetAuthorByNamePatternAsync(G } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -438,7 +437,7 @@ public async Task UpdateAuthorsAsync(UpdateAuthorsArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -484,7 +483,7 @@ public async Task> GetAuthorsByIdsAsync(GetAuthorsByIds } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -541,7 +540,7 @@ public async Task> GetAuthorsByIdsAndNamesAsync } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -579,12 +578,12 @@ public async Task DeleteAuthorAsync(DeleteAuthorArgs args) command.Parameters.AddWithValue("@name", args.Name); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -622,7 +621,7 @@ public async Task CreateBookAsync(CreateBookArgs args) } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -665,7 +664,7 @@ public async Task> ListAllAuthorsBooksAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -712,7 +711,7 @@ public async Task> GetDuplicateAuthorsAsync() } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -765,7 +764,7 @@ public async Task> GetAuthorsByBookNameAsync(GetAu } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -794,12 +793,12 @@ public async Task DeleteAllAuthorsAsync() { await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -857,12 +856,12 @@ public async Task InsertSqliteTypesAsync(InsertSqliteTypesArgs args) command.Parameters.AddWithValue("@c_integer_bool_override", args.CIntegerBoolOverride != null ? (int? )Convert.ToInt32(args.CIntegerBoolOverride) : (object)DBNull.Value); await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -893,8 +892,8 @@ public async Task InsertSqliteTypesBatchAsync(List a { using (var connection = new SqliteConnection(ConnectionString)) { - await connection.OpenAsync(); var transformedSql = Utils.TransformQueryForSqliteBatch(InsertSqliteTypesBatchSql, args.Count); + await connection.OpenAsync(); using (var command = new SqliteCommand(transformedSql, connection)) { for (int i = 0; i < args.Count; i++) @@ -964,12 +963,11 @@ public async Task GetSqliteTypesAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1040,12 +1038,11 @@ public async Task GetSqliteTypesCntAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1103,12 +1100,11 @@ public async Task GetSqliteFunctionsAsync() } } } - } - + }; return null; } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { @@ -1143,12 +1139,12 @@ public async Task DeleteAllSqliteTypesAsync() { await command.ExecuteNonQueryAsync(); } - } - return; + return; + } } - if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != System.Data.ConnectionState.Open) + if (this.Transaction?.Connection == null || this.Transaction?.Connection.State != ConnectionState.Open) throw new InvalidOperationException("Transaction is provided, but its connection is null."); using (var command = this.Transaction.Connection.CreateCommand()) { diff --git a/examples/config/mysql/Dockerfile b/examples/config/mysql/Dockerfile deleted file mode 100644 index 672ba41d..00000000 --- a/examples/config/mysql/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM mysql:8.3.0 - -COPY types/schema.sql types_schema.sql -COPY authors/schema.sql authors_schema.sql - -RUN (cat types_schema.sql && echo && cat authors_schema.sql) > /docker-entrypoint-initdb.d/schema.sql diff --git a/examples/config/mysql/benchmark/query.sql b/examples/config/mysql/benchmark/query.sql new file mode 100644 index 00000000..6c82d891 --- /dev/null +++ b/examples/config/mysql/benchmark/query.sql @@ -0,0 +1,42 @@ +-- name: GetCustomerOrders :many +SELECT + o.order_id, ordered_at, order_state, total_amount, order_item_id, i.quantity, i.unit_price, + p.product_id, p.name as product_name, p.category as product_category +FROM sales.orders o +JOIN sales.order_items i +USING (order_id) +JOIN sales.products p +USING (product_id) +WHERE o.customer_id = ? +ORDER BY o.ordered_at DESC +LIMIT ? OFFSET ?; + +-- name: AddCustomers :copyfrom +INSERT INTO sales.customers (name, email, phone, address, registered_at) VALUES (?, ?, ?, ?, ?); + +-- name: AddProducts :copyfrom +INSERT INTO sales.products (name, category, unit_price, stock_quantity, description) VALUES (?, ?, ?, ?, ?); + +-- name: AddOrders :copyfrom +INSERT INTO sales.orders (customer_id, order_state, total_amount) VALUES (?, ?, ?); + +-- name: AddOrderItems :copyfrom +INSERT INTO sales.order_items (order_id, product_id, quantity, unit_price) VALUES (?, ?, ?, ?); + +-- name: GetCustomerIds :many +SELECT customer_id FROM sales.customers ORDER BY customer_id LIMIT ?; + +-- name: GetProductIds :many +SELECT product_id FROM sales.products ORDER BY product_id LIMIT ?; + +-- name: GetOrderIds :many +SELECT order_id FROM sales.orders ORDER BY order_id LIMIT ?; + +-- name: GetOrderItemsCount :one +SELECT COUNT(*) AS cnt FROM sales.order_items; + +-- name: GetOrderAmounts :many +SELECT order_id, total_amount FROM sales.orders WHERE order_id IN (/*SLICE:order_ids*/?); + +-- name: GetProductPrices :many +SELECT product_id, unit_price FROM sales.products WHERE product_id IN (/*SLICE:product_ids*/?); diff --git a/examples/config/mysql/benchmark/schema.sql b/examples/config/mysql/benchmark/schema.sql new file mode 100644 index 00000000..5a60e926 --- /dev/null +++ b/examples/config/mysql/benchmark/schema.sql @@ -0,0 +1,42 @@ +CREATE DATABASE IF NOT EXISTS sales; + +CREATE TABLE IF NOT EXISTS sales.customers ( + customer_id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(100) NOT NULL, + email VARCHAR(255) UNIQUE NOT NULL, + phone VARCHAR(50) NOT NULL, + address VARCHAR(255), + registered_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS sales.products ( + product_id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(200) NOT NULL, + category VARCHAR(100) NOT NULL, + unit_price DECIMAL(10, 2) NOT NULL, + stock_quantity INT NOT NULL DEFAULT 0, + description TEXT, + added_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS sales.orders ( + order_id BIGINT AUTO_INCREMENT PRIMARY KEY, + customer_id INT NOT NULL, + ordered_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + order_state VARCHAR(10) NOT NULL CHECK (order_state IN ('Pending', 'Delivered', 'Cancelled')), + total_amount DECIMAL(10,2) NOT NULL, + CONSTRAINT fk_customer FOREIGN KEY (customer_id) REFERENCES customers(customer_id) +); + +CREATE TABLE IF NOT EXISTS sales.order_items ( + order_item_id BIGINT AUTO_INCREMENT PRIMARY KEY, + order_id BIGINT NOT NULL, + product_id INT NOT NULL, + quantity INT NOT NULL CHECK (quantity > 0), + unit_price DECIMAL(10,2) NOT NULL, + CONSTRAINT fk_order FOREIGN KEY (order_id) REFERENCES orders(order_id), + CONSTRAINT fk_product FOREIGN KEY (product_id) REFERENCES products(product_id) +); + +CREATE INDEX idx_customer_id_orders ON sales.orders (customer_id); -- lookup of orders by customer_id +CREATE INDEX idx_order_id_order_items ON sales.order_items (order_id); -- lookup of order_items by order_id \ No newline at end of file diff --git a/examples/config/postgresql/Dockerfile b/examples/config/postgresql/Dockerfile deleted file mode 100644 index 75eab979..00000000 --- a/examples/config/postgresql/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM postgres:16.2 - -COPY types/schema.sql types_schema.sql -COPY authors/schema.sql authors_schema.sql - -RUN (cat types_schema.sql && echo && cat authors_schema.sql) > /docker-entrypoint-initdb.d/schema.sql diff --git a/examples/config/postgresql/benchmark/query.sql b/examples/config/postgresql/benchmark/query.sql new file mode 100644 index 00000000..353e9b8d --- /dev/null +++ b/examples/config/postgresql/benchmark/query.sql @@ -0,0 +1,43 @@ +-- name: GetCustomerOrders :many +SELECT + o.order_id, ordered_at, order_state, total_amount, order_item_id, i.quantity, i.unit_price, + p.product_id, p.name as product_name, p.category as product_category +FROM sales.orders o +JOIN sales.order_items i +USING (order_id) +JOIN sales.products p +USING (product_id) +WHERE o.customer_id = sqlc.arg('customer_id') +ORDER BY o.ordered_at DESC +LIMIT sqlc.arg('limit') OFFSET sqlc.arg('offset'); + +-- name: AddCustomers :copyfrom +INSERT INTO sales.customers (name, email, phone, address, registered_at) VALUES ($1, $2, $3, $4, $5); + +-- name: AddProducts :copyfrom +INSERT INTO sales.products (name, category, unit_price, stock_quantity, description) VALUES ($1, $2, $3, $4, $5); + +-- name: AddOrders :copyfrom +INSERT INTO sales.orders (customer_id, order_state, total_amount) VALUES ($1, $2, $3); + +-- name: AddOrderItems :copyfrom +INSERT INTO sales.order_items (order_id, product_id, quantity, unit_price) VALUES ($1, $2, $3, $4); + +-- name: GetCustomerIds :many +SELECT customer_id FROM sales.customers ORDER BY customer_id LIMIT sqlc.arg('limit'); + +-- name: GetProductIds :many +SELECT product_id FROM sales.products ORDER BY product_id LIMIT sqlc.arg('limit'); + +-- name: GetOrderItemsCount :one +SELECT COUNT(*) AS cnt FROM sales.order_items; + +-- name: GetOrderIds :many +SELECT order_id FROM sales.orders ORDER BY ordered_at DESC LIMIT sqlc.arg('limit'); + +-- name: GetOrderAmounts :many +SELECT order_id, total_amount FROM sales.orders WHERE order_id = ANY(sqlc.arg('order_ids')); + +-- name: GetProductPrices :many +SELECT product_id, unit_price FROM sales.products WHERE product_id = ANY(sqlc.arg('product_ids')); + diff --git a/examples/config/postgresql/benchmark/schema.sql b/examples/config/postgresql/benchmark/schema.sql new file mode 100644 index 00000000..fec4b9dc --- /dev/null +++ b/examples/config/postgresql/benchmark/schema.sql @@ -0,0 +1,42 @@ +CREATE SCHEMA sales; + +CREATE TABLE sales.customers ( + customer_id SERIAL PRIMARY KEY, + name VARCHAR(100) NOT NULL, + email VARCHAR(255) UNIQUE NOT NULL, + phone VARCHAR(50) NOT NULL, + address VARCHAR(255), + registered_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE sales.products ( + product_id SERIAL PRIMARY KEY, + name VARCHAR(200) NOT NULL, + category VARCHAR(100) NOT NULL, + unit_price DECIMAL(10, 2) NOT NULL, + stock_quantity INT NOT NULL DEFAULT 0, + description TEXT, + added_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE sales.orders ( + order_id SERIAL PRIMARY KEY, + customer_id INT NOT NULL, + ordered_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + order_state VARCHAR(10) NOT NULL CHECK (order_state IN ('Pending', 'Delivered', 'Cancelled')), + total_amount DECIMAL(10,2) NOT NULL, + CONSTRAINT fk_customer FOREIGN KEY (customer_id) REFERENCES sales.customers(customer_id) +); + +CREATE TABLE sales.order_items ( + order_item_id SERIAL PRIMARY KEY, + order_id INT NOT NULL, + product_id INT NOT NULL, + quantity INT NOT NULL CHECK (quantity > 0), + unit_price DECIMAL(10,2) NOT NULL, + CONSTRAINT fk_order FOREIGN KEY (order_id) REFERENCES sales.orders(order_id), + CONSTRAINT fk_product FOREIGN KEY (product_id) REFERENCES sales.products(product_id) +); + +CREATE INDEX idx_customer_id_orders ON sales.orders (customer_id); -- lookup of orders by customer_id +CREATE INDEX idx_order_id_order_items ON sales.order_items (order_id); -- lookup of order_items by order_id \ No newline at end of file diff --git a/examples/config/postgresql/types/schema.sql b/examples/config/postgresql/types/schema.sql index d5225b32..dfcb92c5 100644 --- a/examples/config/postgresql/types/schema.sql +++ b/examples/config/postgresql/types/schema.sql @@ -60,7 +60,7 @@ CREATE TABLE postgres_geometric_types ( c_circle CIRCLE ); -CREATE EXTENSION "uuid-ossp"; +CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; CREATE TYPE c_enum AS ENUM ('small', 'medium', 'big'); diff --git a/examples/config/sqlite/benchmark/query.sql b/examples/config/sqlite/benchmark/query.sql new file mode 100644 index 00000000..26428764 --- /dev/null +++ b/examples/config/sqlite/benchmark/query.sql @@ -0,0 +1,43 @@ +-- name: GetCustomerOrders :many +SELECT + o.order_id, ordered_at, order_state, total_amount, order_item_id, i.quantity, i.unit_price, + p.product_id, p.name as product_name, p.category as product_category +FROM orders o +JOIN order_items i +USING (order_id) +JOIN products p +USING (product_id) +WHERE o.customer_id = sqlc.arg('customer_id') +ORDER BY o.ordered_at DESC +LIMIT sqlc.arg('limit') OFFSET sqlc.arg('offset'); + +-- name: AddCustomers :copyfrom +INSERT INTO customers (name, email, phone, address, registered_at) VALUES (?, ?, ?, ?, ?); + +-- name: AddProducts :copyfrom +INSERT INTO products (name, category, unit_price, stock_quantity, description) VALUES (?, ?, ?, ?, ?); + +-- name: AddOrders :copyfrom +INSERT INTO orders (customer_id, order_state, total_amount) VALUES (?, ?, ?); + +-- name: AddOrderItems :copyfrom +INSERT INTO order_items (order_id, product_id, quantity, unit_price) VALUES (?, ?, ?, ?); + +-- name: GetCustomerIds :many +SELECT customer_id FROM customers ORDER BY customer_id LIMIT ?; + +-- name: GetProductIds :many +SELECT product_id FROM products ORDER BY product_id LIMIT ?; + +-- name: GetOrderIds :many +SELECT order_id FROM orders ORDER BY order_id LIMIT ?; + +-- name: GetOrderItemsCount :one +SELECT COUNT(*) AS cnt FROM order_items; + +-- name: GetOrderAmounts :many +SELECT order_id, total_amount FROM orders WHERE order_id IN (/*SLICE:order_ids*/?); + +-- name: GetProductPrices :many +SELECT product_id, unit_price FROM products WHERE product_id IN (/*SLICE:product_ids*/?); + diff --git a/examples/config/sqlite/benchmark/schema.sql b/examples/config/sqlite/benchmark/schema.sql new file mode 100644 index 00000000..d95edd66 --- /dev/null +++ b/examples/config/sqlite/benchmark/schema.sql @@ -0,0 +1,40 @@ +CREATE TABLE IF NOT EXISTS customers ( + customer_id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT NOT NULL, + email TEXT UNIQUE NOT NULL, + phone TEXT NOT NULL, + address TEXT, + registered_at TEXT NOT NULL DEFAULT (datetime('now')) +); + +CREATE TABLE IF NOT EXISTS products ( + product_id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT NOT NULL, + category TEXT NOT NULL, + unit_price REAL NOT NULL, + stock_quantity INTEGER NOT NULL DEFAULT 0, + description TEXT, + added_at TEXT NOT NULL DEFAULT (datetime('now')) +); + +CREATE TABLE IF NOT EXISTS orders ( + order_id INTEGER PRIMARY KEY AUTOINCREMENT, + customer_id INTEGER NOT NULL, + ordered_at TEXT NOT NULL DEFAULT (datetime('now')), + order_state TEXT NOT NULL CHECK (order_state IN ('Pending', 'Delivered', 'Cancelled')), + total_amount REAL NOT NULL, + CONSTRAINT fk_customer FOREIGN KEY (customer_id) REFERENCES customers(customer_id) +); + +CREATE TABLE IF NOT EXISTS order_items ( + order_item_id INTEGER PRIMARY KEY AUTOINCREMENT, + order_id INTEGER NOT NULL, + product_id INTEGER NOT NULL, + quantity INTEGER NOT NULL CHECK (quantity > 0), + unit_price REAL NOT NULL, + CONSTRAINT fk_order FOREIGN KEY (order_id) REFERENCES orders(order_id), + CONSTRAINT fk_product FOREIGN KEY (product_id) REFERENCES products(product_id) +); + +CREATE INDEX idx_customer_id_orders ON orders (customer_id); -- lookup of orders by customer_id +CREATE INDEX idx_order_id_order_items ON order_items (order_id); -- lookup of order_items by order_id \ No newline at end of file diff --git a/mysql.Dockerfile b/mysql.Dockerfile new file mode 100644 index 00000000..01a6f214 --- /dev/null +++ b/mysql.Dockerfile @@ -0,0 +1,7 @@ +FROM mysql:8.3.0 + +COPY examples/config/mysql/types/schema.sql types_schema.sql +COPY examples/config/mysql/authors/schema.sql authors_schema.sql +COPY examples/config/mysql/benchmark/schema.sql benchmark_schema.sql + +RUN (cat types_schema.sql && echo && cat authors_schema.sql && echo && cat benchmark_schema.sql) > /docker-entrypoint-initdb.d/schema.sql diff --git a/postgres.Dockerfile b/postgres.Dockerfile new file mode 100644 index 00000000..f44fa20d --- /dev/null +++ b/postgres.Dockerfile @@ -0,0 +1,7 @@ +FROM postgres:16.2 + +COPY examples/config/postgresql/types/schema.sql types_schema.sql +COPY examples/config/postgresql/authors/schema.sql authors_schema.sql +COPY examples/config/postgresql/benchmark/schema.sql benchmark_schema.sql + +RUN (cat types_schema.sql && echo && cat authors_schema.sql && echo && cat benchmark_schema.sql) > /docker-entrypoint-initdb.d/schema.sql diff --git a/sqlc-gen-csharp.sln b/sqlc-gen-csharp.sln index 39a98031..c34c1abd 100644 --- a/sqlc-gen-csharp.sln +++ b/sqlc-gen-csharp.sln @@ -61,6 +61,22 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EndToEndScaffold", "end2end EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RepositoryTests", "unit-tests\RepositoryTests\RepositoryTests.csproj", "{7FEF697A-841D-4E32-A8ED-0F36C4436B55}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmark", "benchmark", "{A796C405-F147-4A0B-A99C-D6419C1AC1EC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostgresqlEFCoreImpl", "benchmark\PostgresqlEFCoreImpl\PostgresqlEFCoreImpl.csproj", "{5C37235B-5CC2-4AB4-8442-2FD8299F9FBD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostgresqlSqlcImpl", "benchmark\PostgresqlSqlcImpl\PostgresqlSqlcImpl.csproj", "{11294023-6930-4633-92ED-461DD8F8B403}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SqliteEFCoreImpl", "benchmark\SqliteEFCoreImpl\SqliteEFCoreImpl.csproj", "{A1B2C3D4-E5F6-4A5B-8C9D-0E1F2A3B4C5D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SqliteSqlcImpl", "benchmark\SqliteSqlcImpl\SqliteSqlcImpl.csproj", "{B2C3D4E5-F6A7-4B5C-9D0E-1F2A3B4C5D6E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MysqlEFCoreImpl", "benchmark\MysqlEFCoreImpl\MysqlEFCoreImpl.csproj", "{C1D2E3F4-A5B6-4C7D-8E9F-0A1B2C3D4E5F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MysqlSqlcImpl", "benchmark\MysqlSqlcImpl\MysqlSqlcImpl.csproj", "{D2E3F4A5-B6C7-4D8E-9F0A-1B2C3D4E5F6A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BenchmarkRunner", "benchmark\BenchmarkRunner\BenchmarkRunner.csproj", "{C024456A-CBDB-4688-A58F-4C4A36F17836}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -189,5 +205,42 @@ Global {645E834B-743F-4D80-9073-98878995FE87}.Debug|Any CPU.Build.0 = Debug|Any CPU {645E834B-743F-4D80-9073-98878995FE87}.Release|Any CPU.ActiveCfg = Release|Any CPU {645E834B-743F-4D80-9073-98878995FE87}.Release|Any CPU.Build.0 = Release|Any CPU + {5C37235B-5CC2-4AB4-8442-2FD8299F9FBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5C37235B-5CC2-4AB4-8442-2FD8299F9FBD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5C37235B-5CC2-4AB4-8442-2FD8299F9FBD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5C37235B-5CC2-4AB4-8442-2FD8299F9FBD}.Release|Any CPU.Build.0 = Release|Any CPU + {11294023-6930-4633-92ED-461DD8F8B403}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {11294023-6930-4633-92ED-461DD8F8B403}.Debug|Any CPU.Build.0 = Debug|Any CPU + {11294023-6930-4633-92ED-461DD8F8B403}.Release|Any CPU.ActiveCfg = Release|Any CPU + {11294023-6930-4633-92ED-461DD8F8B403}.Release|Any CPU.Build.0 = Release|Any CPU + {A1B2C3D4-E5F6-4A5B-8C9D-0E1F2A3B4C5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A1B2C3D4-E5F6-4A5B-8C9D-0E1F2A3B4C5D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A1B2C3D4-E5F6-4A5B-8C9D-0E1F2A3B4C5D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A1B2C3D4-E5F6-4A5B-8C9D-0E1F2A3B4C5D}.Release|Any CPU.Build.0 = Release|Any CPU + {B2C3D4E5-F6A7-4B5C-9D0E-1F2A3B4C5D6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B2C3D4E5-F6A7-4B5C-9D0E-1F2A3B4C5D6E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B2C3D4E5-F6A7-4B5C-9D0E-1F2A3B4C5D6E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B2C3D4E5-F6A7-4B5C-9D0E-1F2A3B4C5D6E}.Release|Any CPU.Build.0 = Release|Any CPU + {C1D2E3F4-A5B6-4C7D-8E9F-0A1B2C3D4E5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C1D2E3F4-A5B6-4C7D-8E9F-0A1B2C3D4E5F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C1D2E3F4-A5B6-4C7D-8E9F-0A1B2C3D4E5F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C1D2E3F4-A5B6-4C7D-8E9F-0A1B2C3D4E5F}.Release|Any CPU.Build.0 = Release|Any CPU + {D2E3F4A5-B6C7-4D8E-9F0A-1B2C3D4E5F6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D2E3F4A5-B6C7-4D8E-9F0A-1B2C3D4E5F6A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D2E3F4A5-B6C7-4D8E-9F0A-1B2C3D4E5F6A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D2E3F4A5-B6C7-4D8E-9F0A-1B2C3D4E5F6A}.Release|Any CPU.Build.0 = Release|Any CPU + {C024456A-CBDB-4688-A58F-4C4A36F17836}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C024456A-CBDB-4688-A58F-4C4A36F17836}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C024456A-CBDB-4688-A58F-4C4A36F17836}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C024456A-CBDB-4688-A58F-4C4A36F17836}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {5C37235B-5CC2-4AB4-8442-2FD8299F9FBD} = {A796C405-F147-4A0B-A99C-D6419C1AC1EC} + {11294023-6930-4633-92ED-461DD8F8B403} = {A796C405-F147-4A0B-A99C-D6419C1AC1EC} + {A1B2C3D4-E5F6-4A5B-8C9D-0E1F2A3B4C5D} = {A796C405-F147-4A0B-A99C-D6419C1AC1EC} + {B2C3D4E5-F6A7-4B5C-9D0E-1F2A3B4C5D6E} = {A796C405-F147-4A0B-A99C-D6419C1AC1EC} + {C1D2E3F4-A5B6-4C7D-8E9F-0A1B2C3D4E5F} = {A796C405-F147-4A0B-A99C-D6419C1AC1EC} + {D2E3F4A5-B6C7-4D8E-9F0A-1B2C3D4E5F6A} = {A796C405-F147-4A0B-A99C-D6419C1AC1EC} + {C024456A-CBDB-4688-A58F-4C4A36F17836} = {A796C405-F147-4A0B-A99C-D6419C1AC1EC} EndGlobalSection EndGlobal diff --git a/sqlc.ci.yaml b/sqlc.ci.yaml index 129c56d6..5d7a1626 100644 --- a/sqlc.ci.yaml +++ b/sqlc.ci.yaml @@ -3,7 +3,7 @@ plugins: - name: csharp wasm: url: file://dist/plugin.wasm - sha256: + sha256: 1ae4a957bea8be1b04cc1da33026f9cebfd9e280f9371b1f1d5fdbba388101be sql: # Basic quick start examples - schema: examples/config/postgresql/authors/schema.sql @@ -24,7 +24,6 @@ sql: codegen: - plugin: csharp out: examples/QuickStartSqliteDalGen - # PostgresSQL - schema: ["examples/config/postgresql/authors/schema.sql", "examples/config/postgresql/types/schema.sql"] queries: ["examples/config/postgresql/authors/query.sql", "examples/config/postgresql/types/query.sql"] @@ -218,7 +217,6 @@ sql: csharp_type: type: "Instant" notNull: false - # MySQL - schema: ["examples/config/mysql/authors/schema.sql", "examples/config/mysql/types/schema.sql"] queries: ["examples/config/mysql/authors/query.sql", "examples/config/mysql/types/query.sql"] @@ -348,7 +346,6 @@ sql: csharp_type: type: "Instant" notNull: false - # Sqlite - schema: ["examples/config/sqlite/authors/schema.sql", "examples/config/sqlite/types/schema.sql"] queries: ["examples/config/sqlite/authors/query.sql", "examples/config/sqlite/types/query.sql"] @@ -505,4 +502,29 @@ sql: type: "Instant" - column: "*:c_integer_noda_instant_override" csharp_type: - type: "Instant" \ No newline at end of file + type: "Instant" + # Benchmark + - schema: "examples/config/postgresql/benchmark/schema.sql" + queries: "examples/config/postgresql/benchmark/query.sql" + engine: "postgresql" + codegen: + - plugin: csharp + out: benchmark/PostgresqlSqlcImpl + options: + namespaceName: PostgresSqlcImpl + - schema: "examples/config/sqlite/benchmark/schema.sql" + queries: "examples/config/sqlite/benchmark/query.sql" + engine: "sqlite" + codegen: + - plugin: csharp + out: benchmark/SqliteSqlcImpl + options: + namespaceName: SqliteSqlcImpl + - schema: "examples/config/mysql/benchmark/schema.sql" + queries: "examples/config/mysql/benchmark/query.sql" + engine: "mysql" + codegen: + - plugin: csharp + out: benchmark/MysqlSqlcImpl + options: + namespaceName: MysqlSqlcImpl diff --git a/sqlc.local.generated.yaml b/sqlc.local.generated.yaml index d9bb0753..72165801 100644 --- a/sqlc.local.generated.yaml +++ b/sqlc.local.generated.yaml @@ -504,3 +504,28 @@ sql: - column: "*:c_integer_noda_instant_override" csharp_type: type: "Instant" + # Benchmark + - schema: "examples/config/postgresql/benchmark/schema.sql" + queries: "examples/config/postgresql/benchmark/query.sql" + engine: "postgresql" + codegen: + - plugin: csharp + out: benchmark/PostgresqlSqlcImpl + options: + namespaceName: PostgresSqlcImpl + - schema: "examples/config/sqlite/benchmark/schema.sql" + queries: "examples/config/sqlite/benchmark/query.sql" + engine: "sqlite" + codegen: + - plugin: csharp + out: benchmark/SqliteSqlcImpl + options: + namespaceName: SqliteSqlcImpl + - schema: "examples/config/mysql/benchmark/schema.sql" + queries: "examples/config/mysql/benchmark/query.sql" + engine: "mysql" + codegen: + - plugin: csharp + out: benchmark/MysqlSqlcImpl + options: + namespaceName: MysqlSqlcImpl diff --git a/sqlc.request.generated.yaml b/sqlc.request.generated.yaml index 66b4e901..995ff171 100644 --- a/sqlc.request.generated.yaml +++ b/sqlc.request.generated.yaml @@ -522,3 +522,31 @@ sql: csharp_type: type: "Instant" debugRequest: true + # Benchmark + - schema: "examples/config/postgresql/benchmark/schema.sql" + queries: "examples/config/postgresql/benchmark/query.sql" + engine: "postgresql" + codegen: + - plugin: csharp + out: benchmark/PostgresqlSqlcImpl + options: + namespaceName: PostgresSqlcImpl + debugRequest: true + - schema: "examples/config/sqlite/benchmark/schema.sql" + queries: "examples/config/sqlite/benchmark/query.sql" + engine: "sqlite" + codegen: + - plugin: csharp + out: benchmark/SqliteSqlcImpl + options: + namespaceName: SqliteSqlcImpl + debugRequest: true + - schema: "examples/config/mysql/benchmark/schema.sql" + queries: "examples/config/mysql/benchmark/query.sql" + engine: "mysql" + codegen: + - plugin: csharp + out: benchmark/MysqlSqlcImpl + options: + namespaceName: MysqlSqlcImpl + debugRequest: true