Ejemplo n.º 1
0
 public DatabaseMetadata(DbConnection connection, Dialect.Dialect dialect, bool extras)
 {
     meta         = dialect.GetDataBaseSchema(connection);
     this.dialect = dialect;
     this.extras  = extras;
     InitSequences(connection, dialect);
     sqlExceptionConverter = dialect.BuildSQLExceptionConverter();
 }
 static IEnumerable <string> GetReservedWords(Dialect.Dialect dialect, IConnectionHelper connectionHelper)
 {
     connectionHelper.Prepare();
     try
     {
         var metaData = dialect.GetDataBaseSchema(connectionHelper.Connection);
         return(metaData.GetReservedWords());
     }
     finally
     {
         connectionHelper.Release();
     }
 }
 static async Task <IEnumerable <string> > GetReservedWordsAsync(Dialect.Dialect dialect, IConnectionHelper connectionHelper, CancellationToken cancellationToken)
 {
     cancellationToken.ThrowIfCancellationRequested();
     await(connectionHelper.PrepareAsync(cancellationToken)).ConfigureAwait(false);
     try
     {
         var metaData = dialect.GetDataBaseSchema(connectionHelper.Connection);
         return(metaData.GetReservedWords());
     }
     finally
     {
         connectionHelper.Release();
     }
 }
Ejemplo n.º 4
0
        private static ISet <string> GetReservedWords(Dialect.Dialect dialect, IConnectionHelper connectionHelper)
        {
            ISet <string> reservedDb = new HashedSet <string>();

            connectionHelper.Prepare();
            try
            {
                var metaData = dialect.GetDataBaseSchema(connectionHelper.Connection);
                foreach (var rw in metaData.GetReservedWords())
                {
                    reservedDb.Add(rw.ToLowerInvariant());
                }
            }
            finally
            {
                connectionHelper.Release();
            }
            return(reservedDb);
        }