Exemple #1
0
        public virtual string GetIndexName(ObjectName tableName)
        {
            int maxLength = MaxNameLength();

            return(StringHashEncoder.ChopHash("IX_{0}_{1}".FormatWith(tableName.Name, ColumnSignature()), maxLength) + WhereSignature());
        }
Exemple #2
0
        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,
            });
        }
Exemple #3
0
 public static string GetPrimaryKeyName(ObjectName tableName)
 {
     return("PK_" + tableName.Schema.Name + "_" + tableName.Name);
 }
Exemple #4
0
        public override string GetIndexName(ObjectName tableName)
        {
            var maxSize = MaxNameLength();

            return(StringHashEncoder.ChopHash("UIX_{0}_{1}".FormatWith(tableName.Name, ColumnSignature()), maxSize) + WhereSignature());
        }
Exemple #5
0
 public View IncludeView(ObjectName viewName, string viewDefinition)
 {
     return(Views[viewName] = new View(viewName, viewDefinition));
 }
Exemple #6
0
 public override string GetIndexName(ObjectName tableName) => GetPrimaryKeyName(tableName);
Exemple #7
0
 public Procedure(string procedureType, ObjectName procedureName, string procedureCodeAndArguments)
 {
     ProcedureType             = procedureType;
     ProcedureName             = procedureName;
     ProcedureCodeAndArguments = procedureCodeAndArguments;
 }
Exemple #8
0
 public View(ObjectName name, string definition)
 {
     Name       = name;
     Definition = definition;
 }
Exemple #9
0
 public Procedure IncludeUserDefinedFunction(ObjectName functionName, string functionCodeAndArguments)
 {
     return(StoreProcedures[functionName] = new Procedure("FUNCTION", functionName, functionCodeAndArguments));
 }
Exemple #10
0
 public Procedure IncludeStoreProcedure(ObjectName procedureName, string procedureCodeAndArguments)
 {
     return(StoreProcedures[procedureName] = new Procedure("PROCEDURE", procedureName, procedureCodeAndArguments));
 }
Exemple #11
0
        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));
        }
Exemple #12
0
 public SystemVersionedInfo(ObjectName tableName, string startColumnName, string endColumnName)
 {
     TableName       = tableName;
     StartColumnName = startColumnName;
     EndColumnName   = endColumnName;
 }
Exemple #13
0
        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));
        }