public virtual string GetIndexName(ObjectName tableName) { int maxLength = MaxNameLength(); return(StringHashEncoder.ChopHash("IX_{0}_{1}".FormatWith(tableName.Name, ColumnSignature()), maxLength) + WhereSignature()); }
public SystemVersionedInfo ToSystemVersionedInfo(SystemVersionedAttribute att, ObjectName tableName) { if (att == null) { return(null); } return(new SystemVersionedInfo { TableName = att.TemporalTableName != null? ObjectName.Parse(att.TemporalTableName) : new ObjectName(tableName.Schema, tableName.Name + "_History"), StartColumnName = att.StartDateColumnName, EndColumnName = att.EndDateColumnName, }); }
public static string GetPrimaryKeyName(ObjectName tableName) { return("PK_" + tableName.Schema.Name + "_" + tableName.Name); }
public override string GetIndexName(ObjectName tableName) { var maxSize = MaxNameLength(); return(StringHashEncoder.ChopHash("UIX_{0}_{1}".FormatWith(tableName.Name, ColumnSignature()), maxSize) + WhereSignature()); }
public View IncludeView(ObjectName viewName, string viewDefinition) { return(Views[viewName] = new View(viewName, viewDefinition)); }
public override string GetIndexName(ObjectName tableName) => GetPrimaryKeyName(tableName);
public Procedure(string procedureType, ObjectName procedureName, string procedureCodeAndArguments) { ProcedureType = procedureType; ProcedureName = procedureName; ProcedureCodeAndArguments = procedureCodeAndArguments; }
public View(ObjectName name, string definition) { Name = name; Definition = definition; }
public Procedure IncludeUserDefinedFunction(ObjectName functionName, string functionCodeAndArguments) { return(StoreProcedures[functionName] = new Procedure("FUNCTION", functionName, functionCodeAndArguments)); }
public Procedure IncludeStoreProcedure(ObjectName procedureName, string procedureCodeAndArguments) { return(StoreProcedures[procedureName] = new Procedure("PROCEDURE", procedureName, procedureCodeAndArguments)); }
public SystemVersionedInfo?ToSystemVersionedInfo(SystemVersionedAttribute?att, ObjectName tableName) { if (att == null) { return(null); } var tn = att.TemporalTableName != null?ObjectName.Parse(att.TemporalTableName) : new ObjectName(tableName.Schema, tableName.Name + "_History"); return(new SystemVersionedInfo(tn, att.StartDateColumnName, att.EndDateColumnName)); }
public SystemVersionedInfo(ObjectName tableName, string startColumnName, string endColumnName) { TableName = tableName; StartColumnName = startColumnName; EndColumnName = endColumnName; }
public SystemVersionedInfo?ToSystemVersionedInfo(SystemVersionedAttribute?att, ObjectName tableName) { if (att == null) { return(null); } var isPostgres = this.schema.Settings.IsPostgres; var tn = att.TemporalTableName != null?ObjectName.Parse(att.TemporalTableName, isPostgres) : new ObjectName(tableName.Schema, tableName.Name + "_History", isPostgres); if (isPostgres) { return(new SystemVersionedInfo(tn, att.PostgreeSysPeriodColumname)); } return(new SystemVersionedInfo(tn, att.StartDateColumnName, att.EndDateColumnName)); }