PostgreSqlDialectProvider
Assembly: ServiceStack.OrmLite.PostgreSQL.dll
View Source
public class PostgreSqlDialectProvider : OrmLiteDialectProviderBase<PostgreSqlDialectProvider>, IOrmLiteDialectProvider
Properties
UseReturningForLastInsertId
View Source
public bool UseReturningForLastInsertId { get; set; }
AutoIdGuidFunction
View Source
public string AutoIdGuidFunction { get; set; }
UseHstore
View Source
public bool UseHstore { set; }
Normalize
View Source
public bool Normalize { get; set; }
TypesMap
View Source
public Dictionary<Type, NpgsqlDbType> TypesMap { get; }
SqlRandom
View Source
public override string SqlRandom { get; }
Fields
Instance
View Source
public static PostgreSqlDialectProvider Instance
ReservedWords
View Source
public static HashSet<string> ReservedWords
RowVersionFieldComparer
View Source
public const string RowVersionFieldComparer = "int8in(xidout(xmin))"
NativeTypes
View Source
public Dictionary<string, NpgsqlDbType> NativeTypes
Methods
GetColumnDefinition(FieldDefinition)
View Source
public override string GetColumnDefinition(FieldDefinition fieldDef)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | fieldDef |
GetAutoIdDefaultValue(FieldDefinition)
View Source
public override string GetAutoIdDefaultValue(FieldDefinition fieldDef)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | fieldDef |
IsFullSelectStatement(String)
View Source
public override bool IsFullSelectStatement(string sql)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | sql |
ShouldSkipInsert(FieldDefinition)
View Source
protected override bool ShouldSkipInsert(FieldDefinition fieldDef)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | fieldDef |
ShouldReturnOnInsert(ModelDefinition, FieldDefinition)
View Source
protected virtual bool ShouldReturnOnInsert(ModelDefinition modelDef, FieldDefinition fieldDef)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ModelDefinition | modelDef |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
HasInsertReturnValues(ModelDefinition)
View Source
public override bool HasInsertReturnValues(ModelDefinition modelDef)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ModelDefinition | modelDef |
PrepareParameterizedInsertStatement<T>(IDbCommand, ICollection<String>, Func<FieldDefinition, Boolean>)
View Source
public override void PrepareParameterizedInsertStatement<T>(IDbCommand cmd, ICollection<string> insertFields = null, Func<FieldDefinition, bool> shouldInclude = null)
Parameters
Type | Name |
---|---|
System.Data.IDbCommand | cmd |
System.Collections.Generic.ICollection<System.String> | insertFields |
System.Func<ServiceStack.OrmLite.FieldDefinition,System.Boolean> | shouldInclude |
Type Parameters
T
GetRowVersionSelectColumn(FieldDefinition, String)
View Source
public override SelectItem GetRowVersionSelectColumn(FieldDefinition field, string tablePrefix = null)
Returns
ServiceStack.OrmLite.SelectItem
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | field |
System.String | tablePrefix |
GetRowVersionColumn(FieldDefinition, String)
View Source
public override string GetRowVersionColumn(FieldDefinition field, string tablePrefix = null)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | field |
System.String | tablePrefix |
AppendFieldCondition(StringBuilder, FieldDefinition, IDbCommand)
View Source
public override void AppendFieldCondition(StringBuilder sqlFilter, FieldDefinition fieldDef, IDbCommand cmd)
Parameters
Type | Name |
---|---|
System.Text.StringBuilder | sqlFilter |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
System.Data.IDbCommand | cmd |
GetQuotedValue(String)
View Source
public override string GetQuotedValue(string paramValue)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | paramValue |
CreateConnection(String, Dictionary<String, String>)
View Source
public override IDbConnection CreateConnection(string connectionString, Dictionary<string, string> options)
Returns
System.Data.IDbConnection
Parameters
Type | Name |
---|---|
System.String | connectionString |
System.Collections.Generic.Dictionary<System.String,System.String> | options |
SqlExpression<T>()
View Source
public override SqlExpression<T> SqlExpression<T>()
Returns
ServiceStack.OrmLite.SqlExpression<T>
Type Parameters
T
CreateParam()
View Source
public override IDbDataParameter CreateParam()
Returns
System.Data.IDbDataParameter
ToTableNamesStatement(String)
View Source
public override string ToTableNamesStatement(string schema)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | schema |
ToTableNamesWithRowCountsStatement(Boolean, String)
View Source
public override string ToTableNamesWithRowCountsStatement(bool live, string schema)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Boolean | live |
System.String | schema |
DoesTableExist(IDbCommand, String, String)
View Source
public override bool DoesTableExist(IDbCommand dbCmd, string tableName, string schema = null)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Data.IDbCommand | dbCmd |
System.String | tableName |
System.String | schema |
DoesTableExistAsync(IDbCommand, String, String, CancellationToken)
View Source
public override async Task<bool> DoesTableExistAsync(IDbCommand dbCmd, string tableName, string schema = null, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.Data.IDbCommand | dbCmd |
System.String | tableName |
System.String | schema |
System.Threading.CancellationToken | token |
GetSchemas(IDbCommand)
View Source
public override List<string> GetSchemas(IDbCommand dbCmd)
Returns
System.Collections.Generic.List<System.String>
Parameters
Type | Name |
---|---|
System.Data.IDbCommand | dbCmd |
GetSchemaTables(IDbCommand)
View Source
public override Dictionary<string, List<string>> GetSchemaTables(IDbCommand dbCmd)
Returns
System.Collections.Generic.Dictionary<System.String,System.Collections.Generic.List<System.String>>
Parameters
Type | Name |
---|---|
System.Data.IDbCommand | dbCmd |
DoesSchemaExist(IDbCommand, String)
View Source
public override bool DoesSchemaExist(IDbCommand dbCmd, string schemaName)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Data.IDbCommand | dbCmd |
System.String | schemaName |
DoesSchemaExistAsync(IDbCommand, String, CancellationToken)
View Source
public override async Task<bool> DoesSchemaExistAsync(IDbCommand dbCmd, string schemaName, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.Data.IDbCommand | dbCmd |
System.String | schemaName |
System.Threading.CancellationToken | token |
ToCreateSchemaStatement(String)
View Source
public override string ToCreateSchemaStatement(string schemaName)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | schemaName |
DoesColumnExist(IDbConnection, String, String, String)
View Source
public override bool DoesColumnExist(IDbConnection db, string columnName, string tableName, string schema = null)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Data.IDbConnection | db |
System.String | columnName |
System.String | tableName |
System.String | schema |
DoesColumnExistAsync(IDbConnection, String, String, String, CancellationToken)
View Source
public override async Task<bool> DoesColumnExistAsync(IDbConnection db, string columnName, string tableName, string schema = null, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.Data.IDbConnection | db |
System.String | columnName |
System.String | tableName |
System.String | schema |
System.Threading.CancellationToken | token |
ToExecuteProcedureStatement(Object)
View Source
public override string ToExecuteProcedureStatement(object objWithProperties)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | objWithProperties |
ToAlterColumnStatement(String, String, FieldDefinition)
View Source
public override string ToAlterColumnStatement(string schema, string table, FieldDefinition fieldDef)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | schema |
System.String | table |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
ShouldQuote(String)
View Source
public override bool ShouldQuote(string name)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | name |
GetQuotedName(String)
View Source
public override string GetQuotedName(string name)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | name |
GetQuotedTableName(ModelDefinition)
View Source
public override string GetQuotedTableName(ModelDefinition modelDef)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ModelDefinition | modelDef |
GetTableName(String, String, Boolean)
View Source
public override string GetTableName(string table, string schema, bool useStrategy)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | table |
System.String | schema |
System.Boolean | useStrategy |
GetLastInsertIdSqlSuffix<T>()
View Source
public override string GetLastInsertIdSqlSuffix<T>()
Returns
System.String
Type Parameters
T
GetDbType<T>()
View Source
public NpgsqlDbType GetDbType<T>()
Returns
NpgsqlDbType
Type Parameters
T
GetDbType(Type)
View Source
public NpgsqlDbType GetDbType(Type type)
Returns
NpgsqlDbType
Parameters
Type | Name |
---|---|
System.Type | type |
SetParameter(FieldDefinition, IDbDataParameter)
View Source
public override void SetParameter(FieldDefinition fieldDef, IDbDataParameter p)
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | fieldDef |
System.Data.IDbDataParameter | p |
UseRawValue(String)
View Source
public virtual bool UseRawValue(string columnDef)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | columnDef |
GetValue(FieldDefinition, Object)
View Source
protected override object GetValue(FieldDefinition fieldDef, object obj)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | fieldDef |
System.Object | obj |
PrepareStoredProcedureStatement<T>(IDbCommand, T)
View Source
public override void PrepareStoredProcedureStatement<T>(IDbCommand cmd, T obj)
Parameters
Type | Name |
---|---|
System.Data.IDbCommand | cmd |
<T> | obj |
Type Parameters
T
ToChangeColumnNameStatement(String, String, FieldDefinition, String)
View Source
public override string ToChangeColumnNameStatement(string schema, string table, FieldDefinition fieldDef, string oldColumn)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | schema |
System.String | table |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
System.String | oldColumn |
SqlConflict(String, String)
View Source
public override string SqlConflict(string sql, string conflictResolution)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | sql |
System.String | conflictResolution |
SqlConcat(IEnumerable<Object>)
View Source
public override string SqlConcat(IEnumerable<object> args)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<System.Object> | args |
SqlCurrency(String, String)
View Source
public override string SqlCurrency(string fieldOrValue, string currencySymbol)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | fieldOrValue |
System.String | currencySymbol |
SqlCast(Object, String)
View Source
public override string SqlCast(object fieldOrValue, string castAs)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | fieldOrValue |
System.String | castAs |
Unwrap(IDbConnection)
View Source
protected DbConnection Unwrap(IDbConnection db)
Returns
System.Data.Common.DbConnection
Parameters
Type | Name |
---|---|
System.Data.IDbConnection | db |
Unwrap(IDbCommand)
View Source
protected DbCommand Unwrap(IDbCommand cmd)
Returns
System.Data.Common.DbCommand
Parameters
Type | Name |
---|---|
System.Data.IDbCommand | cmd |
Unwrap(IDataReader)
View Source
protected DbDataReader Unwrap(IDataReader reader)
Returns
System.Data.Common.DbDataReader
Parameters
Type | Name |
---|---|
System.Data.IDataReader | reader |
OpenAsync(IDbConnection, CancellationToken)
View Source
public override Task OpenAsync(IDbConnection db, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.Data.IDbConnection | db |
System.Threading.CancellationToken | token |
ExecuteReaderAsync(IDbCommand, CancellationToken)
View Source
public override Task<IDataReader> ExecuteReaderAsync(IDbCommand cmd, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Data.IDataReader>
Parameters
Type | Name |
---|---|
System.Data.IDbCommand | cmd |
System.Threading.CancellationToken | token |
ExecuteNonQueryAsync(IDbCommand, CancellationToken)
View Source
public override Task<int> ExecuteNonQueryAsync(IDbCommand cmd, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Int32>
Parameters
Type | Name |
---|---|
System.Data.IDbCommand | cmd |
System.Threading.CancellationToken | token |
ExecuteScalarAsync(IDbCommand, CancellationToken)
View Source
public override Task<object> ExecuteScalarAsync(IDbCommand cmd, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
Type | Name |
---|---|
System.Data.IDbCommand | cmd |
System.Threading.CancellationToken | token |
ReadAsync(IDataReader, CancellationToken)
View Source
public override Task<bool> ReadAsync(IDataReader reader, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.Data.IDataReader | reader |
System.Threading.CancellationToken | token |
ReaderEach<T>(IDataReader, Func<T>, CancellationToken)
View Source
public override async Task<List<T>> ReaderEach<T>(IDataReader reader, Func<T> fn, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Collections.Generic.List<<T>>>
Parameters
Type | Name |
---|---|
System.Data.IDataReader | reader |
System.Func<<T>> | fn |
System.Threading.CancellationToken | token |
Type Parameters
T
ReaderEach<Return>(IDataReader, Action, Return, CancellationToken)
View Source
public override async Task<Return> ReaderEach<Return>(IDataReader reader, Action fn, Return source, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<Return>>
Parameters
Type | Name |
---|---|
System.Data.IDataReader | reader |
System.Action | fn |
<Return> | source |
System.Threading.CancellationToken | token |
Type Parameters
Return
ReaderRead<T>(IDataReader, Func<T>, CancellationToken)
View Source
public override async Task<T> ReaderRead<T>(IDataReader reader, Func<T> fn, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<T>>
Parameters
Type | Name |
---|---|
System.Data.IDataReader | reader |
System.Func<<T>> | fn |
System.Threading.CancellationToken | token |
Type Parameters
T