public static DbConnection CreateConnection(this DatabaseSource databaseSource)
        {
            Argument.IsNotNull(() => databaseSource);

            var provider = databaseSource.GetProvider();

            return(provider?.CreateConnection(databaseSource));
        }
        public static DbSourceGatewayBase CreateGateway(this DatabaseSource databaseSource)
        {
            Argument.IsNotNull(() => databaseSource);

            var dbProvider = databaseSource.GetProvider();

            return(dbProvider?.CreateDbSourceGateway(databaseSource));
        }
Beispiel #3
0
        public SqlTableReader(DatabaseSource source, int offset = 0, int fetchCount = 0, DataSourceParameters parameters = null)
            : base(source.ToString(), offset, fetchCount)
        {
            Argument.IsNotNull(() => source);

            _databaseSource   = source;
            _totalRecordCount = 0;
            QueryParameters   = parameters;
        }
Beispiel #4
0
        private string GetFullTableName(DatabaseSource source)
        {
            if (string.IsNullOrWhiteSpace(source.Schema))
            {
                return($"[{source.Table}]");
            }

            return($"[{source.Schema}].[{source.Table}]");
        }
        public static IList <DbObject> GetObjectsOfType(this DatabaseSource databaseSource, TableType tableType)
        {
            Argument.IsNotNull(() => databaseSource);

            var dataSourceCopy = new DatabaseSource(databaseSource.ToString())
            {
                TableType = tableType
            };

            var gateway = dataSourceCopy.CreateGateway();

            return(gateway?.GetObjects() ?? new List <DbObject>());
        }
Beispiel #6
0
 public PostgreSqlDbSourceGateway(DatabaseSource source)
     : base(source)
 {
 }
        public static DbProvider GetProvider(this DatabaseSource databaseSource)
        {
            Argument.IsNotNull(() => databaseSource);

            return(DbProvider.GetRegisteredProvider(databaseSource.ProviderName));
        }
Beispiel #8
0
 public SqLiteSourceGateway(DatabaseSource source)
     : base(source)
 {
 }
 public FirebirdSourceGateway(DatabaseSource source)
     : base(source)
 {
 }
 protected SqlDbSourceGatewayBase(DatabaseSource source)
     : base(source)
 {
 }
Beispiel #11
0
 public MySqlSourceGateway(DatabaseSource source) : base(source)
 {
 }
Beispiel #12
0
        protected DbSourceGatewayBase(DatabaseSource source)
        {
            Argument.IsNotNull(() => source);

            Source = source;
        }
Beispiel #13
0
 public MsSqlDbSourceGateway(DatabaseSource source)
     : base(source)
 {
 }
Beispiel #14
0
 public OracleSourceGateway(DatabaseSource source)
     : base(source)
 {
 }