@@ -1358,7 +1358,8 @@ INSERT INTO postgres_special_types
13581358 c_xml,
13591359 c_xml_string_override,
13601360 c_uuid,
1361- c_enum
1361+ c_enum,
1362+ c_qualified_enum
13621363 )
13631364 VALUES (
13641365 @c_json,
@@ -1368,7 +1369,8 @@ INSERT INTO postgres_special_types
13681369 @c_xml::xml,
13691370 @c_xml_string_override::xml,
13701371 @c_uuid,
1371- @c_enum::c_enum
1372+ @c_enum::c_enum,
1373+ @c_qualified_enum::c_enum
13721374 )" ;
13731375 public class InsertPostgresSpecialTypesArgs
13741376 {
@@ -1380,6 +1382,7 @@ public class InsertPostgresSpecialTypesArgs
13801382 public string ? CXmlStringOverride { get ; init ; }
13811383 public Guid ? CUuid { get ; init ; }
13821384 public CEnum ? CEnum { get ; init ; }
1385+ public CEnum ? CQualifiedEnum { get ; init ; }
13831386 } ;
13841387 public async Task InsertPostgresSpecialTypesAsync ( InsertPostgresSpecialTypesArgs args )
13851388 {
@@ -1392,6 +1395,7 @@ public async Task InsertPostgresSpecialTypesAsync(InsertPostgresSpecialTypesArgs
13921395 queryParams . Add ( "c_xml_string_override" , args . CXmlStringOverride ) ;
13931396 queryParams . Add ( "c_uuid" , args . CUuid ) ;
13941397 queryParams . Add ( "c_enum" , args . CEnum != null ? args . CEnum . Value . Stringify ( ) : null ) ;
1398+ queryParams . Add ( "c_qualified_enum" , args . CQualifiedEnum != null ? args . CQualifiedEnum . Value . Stringify ( ) : null ) ;
13951399 if ( this . Transaction == null )
13961400 {
13971401 using ( var connection = await GetDataSource ( ) . OpenConnectionAsync ( ) )
@@ -1484,7 +1488,8 @@ public async Task TruncatePostgresNotNullTypesAsync()
14841488 c_xml,
14851489 c_xml_string_override,
14861490 c_uuid,
1487- c_enum
1491+ c_enum,
1492+ c_qualified_enum
14881493 FROM postgres_special_types
14891494 LIMIT 1" ;
14901495 public class GetPostgresSpecialTypesRow
@@ -1497,6 +1502,7 @@ public class GetPostgresSpecialTypesRow
14971502 public string ? CXmlStringOverride { get ; init ; }
14981503 public Guid ? CUuid { get ; init ; }
14991504 public CEnum ? CEnum { get ; init ; }
1505+ public CEnum ? CQualifiedEnum { get ; init ; }
15001506 } ;
15011507 public async Task < GetPostgresSpecialTypesRow ? > GetPostgresSpecialTypesAsync ( )
15021508 {
@@ -1887,74 +1893,4 @@ public async Task TruncatePostgresGeoTypesAsync()
18871893 throw new InvalidOperationException ( "Transaction is provided, but its connection is null." ) ;
18881894 await this . Transaction . Connection . ExecuteAsync ( TruncatePostgresGeoTypesSql , transaction : this . Transaction ) ;
18891895 }
1890-
1891- private const string InsertPostgresQualifiedEnumTypesSql = @"INSERT INTO postgres_qualified_enum_types
1892- (
1893- c_qualified_enum
1894- )
1895- VALUES (
1896- @c_qualified_enum::c_enum
1897- )" ;
1898- public class InsertPostgresQualifiedEnumTypesArgs
1899- {
1900- public CEnum ? CQualifiedEnum { get ; init ; }
1901- } ;
1902- public async Task InsertPostgresQualifiedEnumTypesAsync ( InsertPostgresQualifiedEnumTypesArgs args )
1903- {
1904- var queryParams = new Dictionary < string , object ? > ( ) ;
1905- queryParams . Add ( "c_qualified_enum" , args . CQualifiedEnum != null ? args . CQualifiedEnum . Value . Stringify ( ) : null ) ;
1906- if ( this . Transaction == null )
1907- {
1908- using ( var connection = await GetDataSource ( ) . OpenConnectionAsync ( ) )
1909- {
1910- await connection . ExecuteAsync ( InsertPostgresQualifiedEnumTypesSql , queryParams ) ;
1911- return ;
1912- }
1913- }
1914-
1915- if ( this . Transaction ? . Connection == null || this . Transaction ? . Connection . State != ConnectionState . Open )
1916- throw new InvalidOperationException ( "Transaction is provided, but its connection is null." ) ;
1917- await this . Transaction . Connection . ExecuteAsync ( InsertPostgresQualifiedEnumTypesSql , queryParams , transaction : this . Transaction ) ;
1918- }
1919-
1920- private const string GetPostgresQualifiedEnumTypesSql = @"SELECT
1921- c_qualified_enum
1922- FROM postgres_qualified_enum_types
1923- LIMIT 1" ;
1924- public class GetPostgresQualifiedEnumTypesRow
1925- {
1926- public CEnum ? CQualifiedEnum { get ; init ; }
1927- } ;
1928- public async Task < GetPostgresQualifiedEnumTypesRow ? > GetPostgresQualifiedEnumTypesAsync ( )
1929- {
1930- if ( this . Transaction == null )
1931- {
1932- using ( var connection = await GetDataSource ( ) . OpenConnectionAsync ( ) )
1933- {
1934- var result = await connection . QueryFirstOrDefaultAsync < GetPostgresQualifiedEnumTypesRow ? > ( GetPostgresQualifiedEnumTypesSql ) ;
1935- return result ;
1936- }
1937- }
1938-
1939- if ( this . Transaction ? . Connection == null || this . Transaction ? . Connection . State != ConnectionState . Open )
1940- throw new InvalidOperationException ( "Transaction is provided, but its connection is null." ) ;
1941- return await this . Transaction . Connection . QueryFirstOrDefaultAsync < GetPostgresQualifiedEnumTypesRow ? > ( GetPostgresQualifiedEnumTypesSql , transaction : this . Transaction ) ;
1942- }
1943-
1944- private const string TruncatePostgresQualifiedEnumTypesSql = "TRUNCATE TABLE postgres_qualified_enum_types" ;
1945- public async Task TruncatePostgresQualifiedEnumTypesAsync ( )
1946- {
1947- if ( this . Transaction == null )
1948- {
1949- using ( var connection = await GetDataSource ( ) . OpenConnectionAsync ( ) )
1950- {
1951- await connection . ExecuteAsync ( TruncatePostgresQualifiedEnumTypesSql ) ;
1952- return ;
1953- }
1954- }
1955-
1956- if ( this . Transaction ? . Connection == null || this . Transaction ? . Connection . State != ConnectionState . Open )
1957- throw new InvalidOperationException ( "Transaction is provided, but its connection is null." ) ;
1958- await this . Transaction . Connection . ExecuteAsync ( TruncatePostgresQualifiedEnumTypesSql , transaction : this . Transaction ) ;
1959- }
19601896}
0 commit comments