public void Quote_ArgIsKeywordInLowercase_ArgShouldBeQuoted(string quoteArg)
 {
     var argInLowerCase = quoteArg.ToLower();
     var actual = new FirebirdQuoter().Quote(argInLowerCase);
     var expected = String.Format("\"{0}\"", argInLowerCase);
     actual.ShouldBe(expected);
 }
        public FirebirdColumn([NotNull] FirebirdOptions fbOptions, FirebirdQuoter quoter) : base(new FirebirdTypeMap(), quoter)
        {
            FBOptions = fbOptions;

            //In firebird DEFAULT clause precedes NULLABLE clause
            ClauseOrder = new List <Func <ColumnDefinition, string> > {
                FormatString, FormatType, FormatDefaultValue, FormatNullable, FormatPrimaryKey, FormatIdentity
            };
        }
예제 #3
0
        public FirebirdGenerator(
            [NotNull] FirebirdQuoter quoter,
            [NotNull] FirebirdOptions fbOptions,
            [NotNull] IOptions <GeneratorOptions> generatorOptions)
            : base(new FirebirdColumn(fbOptions), quoter, new EmptyDescriptionGenerator(), generatorOptions)
        {
            FBOptions = fbOptions ?? throw new ArgumentNullException(nameof(fbOptions));
#pragma warning disable 618
            truncator = new FirebirdTruncator(FBOptions.TruncateLongNames, FBOptions.PackKeyNames);
#pragma warning restore 618
        }
예제 #4
0
 public static TableInfo Read(FirebirdProcessor processor, string tableName)
 {
     var quoter = new FirebirdQuoter();
     var fbTableName = quoter.ToFbObjectName(tableName);
     return new TableInfo(processor.Read(query, AdoHelper.FormatValue(fbTableName)).Tables[0].Rows[0]);
 }
예제 #5
0
 public static SequenceInfo Read(FirebirdProcessor processor, string sequenceName)
 {
     var fbSequenceName = new FirebirdQuoter().ToFbObjectName(sequenceName);
     using (DataSet ds = processor.Read(query, AdoHelper.FormatValue(fbSequenceName)))
     {
         return new SequenceInfo(ds.Tables[0].Rows[0], processor);
     }
 }
 public void Quote_PassesTurkishTest()
 {
     var actual = new FirebirdQuoter().Quote("similar");
     actual.ShouldBe("\"similar\"");
 }
 public void Quote_ArgIsNotAKeyWord_ArgShouldNotBeQuoted(string quoteArg)
 {
     var actual = new FirebirdQuoter().Quote(quoteArg);
     actual.ShouldBe(quoteArg);
 }
 public void Quote_ArgIsFirebirdKeyword_ArgShouldBeQuoted(string quoteArg)
 {
     var actual = new FirebirdQuoter().Quote(quoteArg);
     var expected = String.Format("\"{0}\"", quoteArg);
     actual.ShouldBe(expected);
 }
 public void Quote_ArgBeginsWithUnderscore_ArgShouldBeQuoted(string quoteArg)
 {
     var actual = new FirebirdQuoter().Quote(quoteArg);
     actual.ShouldBe(string.Format("\"{0}\"", quoteArg));
 }