Ejemplo n.º 1
0
		public Sql92QueryFormatter(SqlQueryFormatterOptions options = SqlQueryFormatterOptions.Default, SqlDialect sqlDialect = null, SqlDataTypeProvider sqlDataTypeProvider = null, TypeDescriptorProvider typeDescriptorProvider = null)
			: base(sqlDialect, new StringWriter(new StringBuilder()))
		{
			this.options = options;
			this.typeDescriptorProvider = typeDescriptorProvider;
			this.sqlDataTypeProvider = sqlDataTypeProvider ?? new DefaultSqlDataTypeProvider(new ConstraintDefaultsConfiguration());
			this.stringQuote = this.sqlDialect.GetSyntaxSymbolString(SqlSyntaxSymbol.StringQuote);
			this.identifierQuoteString = this.sqlDialect.GetSyntaxSymbolString(SqlSyntaxSymbol.IdentifierQuote);
		}
Ejemplo n.º 2
0
        public Sql92QueryFormatter(SqlQueryFormatterOptions options = SqlQueryFormatterOptions.Default, SqlDialect sqlDialect = null, SqlDataTypeProvider sqlDataTypeProvider = null)
            : base(sqlDialect, new StringWriter(new StringBuilder()))
        {
            this.options = options;

            if (sqlDataTypeProvider == null)
            {
                this.sqlDataTypeProvider = new DefaultSqlDataTypeProvider(ConstraintDefaults.Default);
            }
            else
            {
                this.sqlDataTypeProvider = sqlDataTypeProvider;
            }

            this.stringQuote           = this.sqlDialect.GetSyntaxSymbolString(SqlSyntaxSymbol.StringQuote);
            this.identifierQuoteString = this.sqlDialect.GetSyntaxSymbolString(SqlSyntaxSymbol.IdentifierQuote);
        }
Ejemplo n.º 3
0
        public Sql92QueryFormatter(SqlQueryFormatterOptions options = SqlQueryFormatterOptions.Default, SqlDialect sqlDialect = null, SqlDataTypeProvider sqlDataTypeProvider = null)
            : base(sqlDialect, new StringWriter(new StringBuilder()))
        {
            this.options = options;

            if (sqlDataTypeProvider == null)
            {
                this.sqlDataTypeProvider = new DefaultSqlDataTypeProvider(ConstraintDefaults.Default);
            }
            else
            {
                this.sqlDataTypeProvider = sqlDataTypeProvider;
            }

            this.stringQuote = this.sqlDialect.GetSyntaxSymbolString(SqlSyntaxSymbol.StringQuote);
            this.identifierQuoteString = this.sqlDialect.GetSyntaxSymbolString(SqlSyntaxSymbol.IdentifierQuote);
        }
		public PostgresSqlQueryFormatter(SqlQueryFormatterOptions options, SqlDialect sqlDialect, SqlDataTypeProvider sqlDataTypeProvider, TypeDescriptorProvider typeDescriptorProvider, string schemaName, bool convertEnumsToText)
			: base(options, sqlDialect, sqlDataTypeProvider, typeDescriptorProvider)
		{
			this.schemaName = schemaName;
			this.ConvertEnumsToText = convertEnumsToText;
		}
Ejemplo n.º 5
0
		protected override Expression VisitConstantPlaceholder(SqlConstantPlaceholderExpression constantPlaceholderExpression)
		{
			if ((this.options & SqlQueryFormatterOptions.EvaluateConstantPlaceholders) != 0)
			{
				var startIndex = this.parameterValues.Count;

				var savedOptions = this.options;

				// Never optimise-out null constant placeholders

				this.options &= ~SqlQueryFormatterOptions.OptimiseOutConstantNulls;

				var retval = base.VisitConstantPlaceholder(constantPlaceholderExpression);

				this.options = savedOptions;

				var endIndex = this.parameterValues.Count;

				if (endIndex - startIndex == 1 && canReuse)
				{
					var index = startIndex;

					parameterIndexToPlaceholderIndexes.Add(new Pair<int, int>(index, constantPlaceholderExpression.Index));
				}

				return retval;
			}
			else
			{
				this.WriteFormat("$${0}", constantPlaceholderExpression.Index);

				return constantPlaceholderExpression;
			}
		}
Ejemplo n.º 6
0
 public SqliteSqlQueryFormatter(SqlQueryFormatterOptions options, SqlDialect sqlDialect, SqlDataTypeProvider sqlDataTypeProvider)
     : base(options, sqlDialect, sqlDataTypeProvider)
 {
 }
 public PostgresSharedSqlQueryFormatter(SqlQueryFormatterOptions options, SqlDialect sqlDialect, SqlDataTypeProvider sqlDataTypeProvider, string schemaName)
     : base(options, sqlDialect, sqlDataTypeProvider)
 {
     this.schemaName = schemaName;
 }
Ejemplo n.º 8
0
 public abstract SqlQueryFormatter CreateQueryFormatter(SqlQueryFormatterOptions options = SqlQueryFormatterOptions.Default);
Ejemplo n.º 9
0
 public SqlServerSqlQueryFormatter(SqlQueryFormatterOptions options, SqlDialect sqlDialect, SqlDataTypeProvider sqlDataTypeProvider)
     : base(options, sqlDialect, sqlDataTypeProvider)
 {
 }
Ejemplo n.º 10
0
 public virtual SqlQueryFormatResult Format(Expression expression, SqlQueryFormatterOptions options = SqlQueryFormatterOptions.Default, IDbConnection connection = null)
 {
     return(this.CreateQueryFormatter(options, connection).Format(expression));
 }
Ejemplo n.º 11
0
 public abstract SqlQueryFormatter CreateQueryFormatter(SqlQueryFormatterOptions options = SqlQueryFormatterOptions.Default, IDbConnection connection = null);
Ejemplo n.º 12
0
 public MySqlSqlQueryFormatter(SqlQueryFormatterOptions options, SqlDialect sqlDialect, SqlDataTypeProvider sqlDataTypeProvider, TypeDescriptorProvider typeDescriptorProvider, bool silentlyIgnoreIndexConditions)
     : base(options, sqlDialect, sqlDataTypeProvider, typeDescriptorProvider)
 {
     this.silentlyIgnoreIndexConditions = silentlyIgnoreIndexConditions;
 }
Ejemplo n.º 13
0
 public Sql92QueryFormatter(SqlQueryFormatterOptions options)
     : this(options, null, null)
 {
 }
Ejemplo n.º 14
0
		public SqliteSqlQueryFormatter(SqlQueryFormatterOptions options, SqlDialect sqlDialect,  SqlDataTypeProvider sqlDataTypeProvider, TypeDescriptorProvider typeDescriptorProvider)
			: base(options, sqlDialect, sqlDataTypeProvider, typeDescriptorProvider)
		{
		}
		public PostgresDotConnectSqlQueryFormatter(SqlQueryFormatterOptions options, SqlDialect sqlDialect, SqlDataTypeProvider sqlDataTypeProvider, TypeDescriptorProvider typeDescriptorProvider, string schemaName, bool convertEnumsToText)
			: base(options, sqlDialect, sqlDataTypeProvider, typeDescriptorProvider, schemaName, convertEnumsToText)
		{
		}
 public SqlServerSqlQueryFormatter(SqlQueryFormatterOptions options, SqlDialect sqlDialect, SqlDataTypeProvider sqlDataTypeProvider, TypeDescriptorProvider typeDescriptorProvider, SqlServerSqlDatabaseContextInfo contextInfo, string serverVersion)
     : base(options, sqlDialect, sqlDataTypeProvider, typeDescriptorProvider)
 {
     this.contextInfo  = contextInfo;
     this.majorVersion = serverVersion == null ? null : (int?)Convert.ToInt32(serverVersion.Split('.')[0]);
 }
Ejemplo n.º 17
0
 public override SqlQueryFormatter CreateQueryFormatter(SqlQueryFormatterOptions options = SqlQueryFormatterOptions.Default, IDbConnection connection = null)
 {
     return(this.ConstructorMethod(options, connection));
 }
Ejemplo n.º 18
0
 public SqlServerSqlQueryFormatter(SqlQueryFormatterOptions options, SqlDialect sqlDialect, SqlDataTypeProvider sqlDataTypeProvider, TypeDescriptorProvider typeDescriptorProvider)
     : base(options, sqlDialect, sqlDataTypeProvider, typeDescriptorProvider)
 {
 }
Ejemplo n.º 19
0
 public override SqlQueryFormatter CreateQueryFormatter(SqlQueryFormatterOptions options = SqlQueryFormatterOptions.Default)
 {
     return(this.ConstructorMethod(options, this.SqlDialect, this.SqlDataTypeProvider));
 }
 public override SqlQueryFormatter CreateQueryFormatter(SqlQueryFormatterOptions options = SqlQueryFormatterOptions.Default)
 {
     return this.ConstructorMethod(options, this.SqlDialect, this.SqlDataTypeProvider);
 }
Ejemplo n.º 21
0
 public PostgresSqlQueryFormatter(SqlQueryFormatterOptions options, SqlDialect sqlDialect, SqlDataTypeProvider sqlDataTypeProvider, TypeDescriptorProvider typeDescriptorProvider, string schemaName, bool convertEnumsToText)
     : base(options, sqlDialect, sqlDataTypeProvider, typeDescriptorProvider)
 {
     this.schemaName         = schemaName;
     this.ConvertEnumsToText = convertEnumsToText;
 }
Ejemplo n.º 22
0
 public PostgresSharedSqlQueryFormatter(SqlQueryFormatterOptions options, SqlDialect sqlDialect, SqlDataTypeProvider sqlDataTypeProvider, string schemaName)
     : base(options, sqlDialect, sqlDataTypeProvider)
 {
     this.schemaName = schemaName;
 }
Ejemplo n.º 23
0
 public virtual SqlQueryFormatResult Format(Expression expression, SqlQueryFormatterOptions options = SqlQueryFormatterOptions.Default)
 {
     return(this.CreateQueryFormatter(options).Format(expression));
 }
Ejemplo n.º 24
0
		public abstract SqlQueryFormatter CreateQueryFormatter(SqlQueryFormatterOptions options = SqlQueryFormatterOptions.Default);
 public PostgresDotConnectSqlQueryFormatter(SqlQueryFormatterOptions options, SqlDialect sqlDialect, SqlDataTypeProvider sqlDataTypeProvider, TypeDescriptorProvider typeDescriptorProvider, string schemaName, bool convertEnumsToText)
     : base(options, sqlDialect, sqlDataTypeProvider, typeDescriptorProvider, schemaName, convertEnumsToText)
 {
 }
Ejemplo n.º 26
0
		public virtual SqlQueryFormatResult Format(Expression expression, SqlQueryFormatterOptions options = SqlQueryFormatterOptions.Default)
		{
			return this.CreateQueryFormatter(options).Format(expression);
		}
 public override SqlQueryFormatter CreateQueryFormatter(SqlQueryFormatterOptions options = SqlQueryFormatterOptions.Default)
 {
     return(this.ConstructorMethod(options));
 }
		public override SqlQueryFormatter CreateQueryFormatter(SqlQueryFormatterOptions options = SqlQueryFormatterOptions.Default)
		{
			return this.ConstructorMethod(options);
		}