-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#123 escapeNames not correctly passed down postgresql indexes
- Loading branch information
Showing
10 changed files
with
47 additions
and
10 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 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
34 changes: 34 additions & 0 deletions
34
DatabaseSchemaReaderTest/SqlGen/PostgreSql/GeneratorTest.cs
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,34 @@ | ||
using DatabaseSchemaReader.DataSchema; | ||
using DatabaseSchemaReader.SqlGen; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace DatabaseSchemaReaderTest.SqlGen.PostgreSql | ||
{ | ||
[TestClass] | ||
public class GeneratorTest | ||
{ | ||
[TestMethod] | ||
public void TestGeneratorEscaping() | ||
{ | ||
//arrange | ||
var schema = new DatabaseSchema(null, SqlType.PostgreSql); | ||
var table = schema.AddTable("AllTypes") | ||
.AddColumn<int>("Id").AddIdentity() | ||
.AddColumn<string>("Name").AddLength(200) | ||
.AddColumn<int>("Age") | ||
.AddColumn<int>("Period") | ||
.Table; | ||
table.AddIndex("TableIndex", new[] { table.FindColumn("Name") }); | ||
|
||
var factory = new DdlGeneratorFactory(SqlType.PostgreSql); | ||
var tableGen = factory.TableGenerator(table); | ||
tableGen.EscapeNames = false; | ||
|
||
//act | ||
var ddl = tableGen.Write(); | ||
|
||
//assert | ||
Assert.IsTrue(ddl.Contains("INDEX TableIndex ON AllTypes(Name)")); | ||
} | ||
} | ||
} |
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