-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
297 additions
and
314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Text; | ||
|
||
namespace OrigoDB.Core.Storage.Sql | ||
{ | ||
public class MsSqlStatements : SqlStatements | ||
{ | ||
public MsSqlStatements() | ||
{ | ||
ReadEntries = "SELECT Id, Created, Data FROM {0} WHERE Id >= @id ORDER BY Id"; | ||
InitStore = BuildInitStatement(); | ||
AppendEntry = "INSERT INTO {0} VALUES (@Id, @Created, @Type, @Data);"; | ||
} | ||
|
||
private string BuildInitStatement() | ||
{ | ||
var sb = new StringBuilder(); | ||
sb.Append("IF NOT EXISTS ( SELECT * FROM sys.tables WHERE name = '{0}')\n"); | ||
sb.Append("CREATE TABLE {0}\n"); | ||
sb.AppendLine("("); | ||
sb.AppendLine(" Id bigint not null primary key,"); | ||
sb.AppendLine(" Created datetime not null,"); | ||
sb.AppendLine(" Type varchar(1024) not null,"); | ||
sb.AppendLine(" Data varbinary(max) not null);"); | ||
return sb.ToString(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Text; | ||
|
||
namespace OrigoDB.Core.Storage.Sql | ||
{ | ||
public class OleDbStatements : SqlStatements | ||
{ | ||
public OleDbStatements() | ||
{ | ||
ReadEntries = "SELECT Id, Created, Data FROM {0} WHERE Id >= ? ORDER BY ID"; | ||
InitStore = BuildInitStatement(); | ||
AppendEntry = "INSERT INTO {0} VALUES (?,?,?,?);"; | ||
} | ||
private string BuildInitStatement() | ||
{ | ||
var sb = new StringBuilder(); | ||
sb.Append("IF NOT EXISTS ( SELECT * FROM INFORMATION.TABLES WHERE TABLE_NAME = '{0}')\n"); | ||
sb.Append("CREATE TABLE {0}\n"); | ||
sb.AppendLine("("); | ||
sb.AppendLine(" Id bigint not null primary key,"); | ||
sb.AppendLine(" Created datetime not null,"); | ||
sb.AppendLine(" Type varchar(1024) not null,"); | ||
sb.AppendLine(" Data varbinary(max) not null);"); | ||
return sb.ToString(); | ||
} | ||
} | ||
} |
Oops, something went wrong.