public override string GetVariableDeclaration(QueryType type, bool suppressSize) { // TODO: !!! var sb = new StringBuilder(); var sqlType = (DbQueryType)type; var sqlDbType = sqlType.SqlDbType; switch (sqlDbType) { case SqlDbType.Bit: { sb.Append("BOOLEAN"); break; } case SqlDbType.SmallInt: { sb.Append("SMALLINT"); break; } case SqlDbType.Xml: { sb.Append("XMLNODE"); break; } } return sb.ToString(); }
public override string GetVariableDeclaration(QueryType type, bool suppressSize) { StringBuilder sb = new StringBuilder(); DbQueryType sqlType = (DbQueryType)type; SqlDbType sqlDbType = sqlType.SqlDbType; switch (sqlDbType) { case SqlDbType.BigInt: case SqlDbType.Bit: case SqlDbType.DateTime: case SqlDbType.Int: case SqlDbType.Money: case SqlDbType.SmallDateTime: case SqlDbType.SmallInt: case SqlDbType.SmallMoney: case SqlDbType.Timestamp: case SqlDbType.TinyInt: case SqlDbType.UniqueIdentifier: case SqlDbType.Variant: case SqlDbType.Xml: sb.Append(sqlDbType); break; case SqlDbType.Binary: case SqlDbType.Char: case SqlDbType.NChar: sb.Append(sqlDbType); if (type.Length > 0 && !suppressSize) { sb.Append("("); sb.Append(type.Length); sb.Append(")"); } break; case SqlDbType.Image: case SqlDbType.NText: case SqlDbType.NVarChar: case SqlDbType.Text: case SqlDbType.VarBinary: case SqlDbType.VarChar: sb.Append(sqlDbType); if (type.Length > 0 && !suppressSize) { sb.Append("("); sb.Append(type.Length); sb.Append(")"); } break; case SqlDbType.Decimal: sb.Append("Currency"); break; case SqlDbType.Float: case SqlDbType.Real: sb.Append(sqlDbType); if (type.Precision != 0) { sb.Append("("); sb.Append(type.Precision); if (type.Scale != 0) { sb.Append(","); sb.Append(type.Scale); } sb.Append(")"); } break; } return sb.ToString(); }
public QueryParameter(string name, Type type, QueryType queryType) { this.name = name; this.type = type; this.queryType = queryType; }
protected virtual OleDbType GetOleDbType(QueryType type) { return ToOleDbType(((DbQueryType)type).SqlDbType); }
protected override OleDbType GetOleDbType(QueryType type) { DbQueryType sqlType = type as DbQueryType; if (sqlType != null) { return ToOleDbType(sqlType.SqlDbType); } return base.GetOleDbType(type); }
public abstract string GetVariableDeclaration(QueryType type, bool suppressSize);
public QueryParameter(string name, Type type, QueryType queryType) { this.Name = name; this.Type = type; this.QueryType = queryType; }
public VariableExpression(string name, Type type, QueryType queryType) { this.Name = name; this.Type = type; this.QueryType = queryType; }
public VariableDeclaration(string name, QueryType queryType, Expression expression) { this.Name = name; this.QueryType = queryType; this.Expression = expression; }
public VariableExpression(string name, Type type, QueryType queryType) : base((ExpressionType)DbExpressionType.Variable, type) { this.name = name; this.queryType = queryType; }
public VariableDeclaration(string name, QueryType type, Expression expression) { this.name = name; this.type = type; this.expression = expression; }
public DbColumnExpression(Type type, QueryType queryType, TableAlias alias, string name) : base(DbExpressionType.Column, type) { this.Alias = alias; this.QueryType = queryType ?? throw new ArgumentNullException("queryType"); this.Name = name ?? throw new ArgumentNullException("name"); }
public DbNamedValueExpression(string name, QueryType queryType, Expression value) : base(DbExpressionType.NamedValue, value.Type) { this.Name = name ?? throw new ArgumentNullException("name"); this.QueryType = queryType; this.Value = value ?? throw new ArgumentNullException("value"); }
public DbColumnDeclaration(string name, Expression expression, QueryType queryType) { this.Name = name ?? throw new ArgumentNullException("name"); this.Expression = expression ?? throw new ArgumentNullException("expression"); this.QueryType = queryType ?? throw new ArgumentNullException("queryType"); }
public override string GetVariableDeclaration(QueryType type, bool suppressSize) { StringBuilder sb = new StringBuilder(); DbQueryType sqlType = (DbQueryType)type; SqlDbType sqlDbType = sqlType.SqlDbType; switch (sqlDbType) { case SqlDbType.BigInt: case SqlDbType.SmallInt: case SqlDbType.Int: case SqlDbType.TinyInt: sb.Append("INTEGER"); break; case SqlDbType.Bit: sb.Append("BOOLEAN"); break; case SqlDbType.SmallDateTime: sb.Append("DATETIME"); break; case SqlDbType.Char: case SqlDbType.NChar: sb.Append("CHAR"); if (type.Length > 0 && !suppressSize) { sb.Append("("); sb.Append(type.Length); sb.Append(")"); } break; case SqlDbType.Variant: case SqlDbType.Binary: case SqlDbType.Image: case SqlDbType.UniqueIdentifier: //There is a setting to make it string, look at later sb.Append("BLOB"); if (type.Length > 0 && !suppressSize) { sb.Append("("); sb.Append(type.Length); sb.Append(")"); } break; case SqlDbType.Xml: case SqlDbType.NText: case SqlDbType.NVarChar: case SqlDbType.Text: case SqlDbType.VarBinary: case SqlDbType.VarChar: sb.Append("TEXT"); if (type.Length > 0 && !suppressSize) { sb.Append("("); sb.Append(type.Length); sb.Append(")"); } break; case SqlDbType.Decimal: case SqlDbType.Money: case SqlDbType.SmallMoney: sb.Append("NUMERIC"); if (type.Precision != 0) { sb.Append("("); sb.Append(type.Precision); sb.Append(")"); } break; case SqlDbType.Float: case SqlDbType.Real: sb.Append("FLOAT"); if (type.Precision != 0) { sb.Append("("); sb.Append(type.Precision); sb.Append(")"); } break; case SqlDbType.Date: case SqlDbType.DateTime: case SqlDbType.Timestamp: default: sb.Append(sqlDbType); break; } return sb.ToString(); }