2013-01-25 15:05:42 -01:00
|
|
|
using System;
|
2012-10-23 08:09:01 -02:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Umbraco.Core.Persistence.DatabaseAnnotations;
|
2012-12-19 15:23:05 -01:00
|
|
|
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
|
2012-10-23 08:09:01 -02:00
|
|
|
|
|
|
|
|
namespace Umbraco.Core.Persistence.SqlSyntax
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Defines an SqlSyntaxProvider
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface ISqlSyntaxProvider
|
|
|
|
|
{
|
|
|
|
|
string GetQuotedTableName(string tableName);
|
|
|
|
|
string GetQuotedColumnName(string columnName);
|
|
|
|
|
string GetQuotedName(string name);
|
|
|
|
|
bool DoesTableExist(Database db, string tableName);
|
|
|
|
|
string GetIndexType(IndexTypes indexTypes);
|
|
|
|
|
string GetSpecialDbType(SpecialDbTypes dbTypes);
|
2012-11-30 15:01:52 -01:00
|
|
|
string CreateTable { get; }
|
|
|
|
|
string DropTable { get; }
|
|
|
|
|
string AddColumn { get; }
|
|
|
|
|
string DropColumn { get; }
|
|
|
|
|
string AlterColumn { get; }
|
|
|
|
|
string RenameColumn { get; }
|
|
|
|
|
string RenameTable { get; }
|
|
|
|
|
string CreateSchema { get; }
|
|
|
|
|
string AlterSchema { get; }
|
|
|
|
|
string DropSchema { get; }
|
|
|
|
|
string CreateIndex { get; }
|
|
|
|
|
string DropIndex { get; }
|
|
|
|
|
string InsertData { get; }
|
|
|
|
|
string UpdateData { get; }
|
|
|
|
|
string DeleteData { get; }
|
|
|
|
|
string CreateConstraint { get; }
|
|
|
|
|
string DeleteConstraint { get; }
|
|
|
|
|
string CreateForeignKeyConstraint { get; }
|
2012-12-20 11:36:20 -01:00
|
|
|
string DeleteDefaultConstraint { get; }
|
2012-12-19 15:23:05 -01:00
|
|
|
string Format(TableDefinition table);
|
|
|
|
|
string Format(IEnumerable<ColumnDefinition> columns);
|
|
|
|
|
List<string> Format(IEnumerable<IndexDefinition> indexes);
|
|
|
|
|
List<string> Format(IEnumerable<ForeignKeyDefinition> foreignKeys);
|
|
|
|
|
string FormatPrimaryKey(TableDefinition table);
|
|
|
|
|
string GetQuotedValue(string value);
|
|
|
|
|
string Format(ColumnDefinition column);
|
2012-12-20 11:36:20 -01:00
|
|
|
string Format(IndexDefinition index);
|
|
|
|
|
string Format(ForeignKeyDefinition foreignKey);
|
|
|
|
|
string FormatColumnRename(string tableName, string oldName, string newName);
|
|
|
|
|
string FormatTableRename(string oldName, string newName);
|
2012-12-26 14:44:42 -01:00
|
|
|
bool SupportsClustered();
|
2012-12-27 18:52:47 -01:00
|
|
|
bool SupportsIdentityInsert();
|
2013-02-25 13:14:26 -01:00
|
|
|
bool? SupportsCaseInsensitiveQueries(Database db);
|
2013-01-25 15:05:42 -01:00
|
|
|
IEnumerable<string> GetTablesInSchema(Database db);
|
|
|
|
|
IEnumerable<ColumnInfo> GetColumnsInSchema(Database db);
|
|
|
|
|
IEnumerable<Tuple<string, string>> GetConstraintsPerTable(Database db);
|
|
|
|
|
IEnumerable<Tuple<string, string, string>> GetConstraintsPerColumn(Database db);
|
2012-10-23 08:09:01 -02:00
|
|
|
}
|
|
|
|
|
}
|