public SqlServerConnection(TflConnection element, AbstractConnectionDependencies dependencies) : base(element, dependencies) { Type = ProviderType.SqlServer; L = "["; R = "]"; TextQualifier = "'"; IsDatabase = true; InsertMultipleRows = true; Top = true; NoLock = true; TableVariable = true; NoCount = true; IndexInclude = true; Views = true; Schemas = true; MaxDop = true; TableSample = true; DefaultSchema = "dbo"; ConnectionStringProperties.UserProperty = "User Id"; ConnectionStringProperties.PasswordProperty = "Password"; ConnectionStringProperties.DatabaseProperty = "Database"; ConnectionStringProperties.ServerProperty = "Server"; ConnectionStringProperties.TrustedProperty = "Trusted_Connection"; ConnectionStringProperties.PersistSecurityInfoProperty = "Persist Security Info"; }
public AnalysisServicesConnection(TflConnection element, AbstractConnectionDependencies dependencies) : base(element, dependencies) { Type = ProviderType.AnalysisServices; ConnectionStringProperties.DatabaseProperty = "Catalog"; ConnectionStringProperties.ServerProperty = "Data Source"; }
public ElasticSearchConnection(TflConnection element, AbstractConnectionDependencies dependencies) : base(element, dependencies) { Type = ProviderType.ElasticSearch; IsDatabase = true; TextQualifier = string.Empty; }
public LuceneConnection(TflConnection element, AbstractConnectionDependencies dependencies) : base(element, dependencies) { Type = ProviderType.Lucene; IsDatabase = true; TextQualifier = string.Empty; }
public MailConnection(TflConnection element, AbstractConnectionDependencies dependencies) : base(element, dependencies) { Type = ProviderType.Mail; var port = Port > 0 ? Port : 25; if (string.IsNullOrEmpty(User)) { _smtpClient = new SmtpClient { Port = port, EnableSsl = EnableSsl, Host = Server }; } else { _smtpClient = new SmtpClient { Port = port, EnableSsl = EnableSsl, DeliveryMethod = SmtpDeliveryMethod.Network, UseDefaultCredentials = false, Credentials = new NetworkCredential(User, Password), Host = Server }; } }
public FileImportResult Import(FileInspectionRequest request, TflConnection output) { var fileInformation = FileInformationFactory.Create(request, _logger); var cfg = BuildProcess(fileInformation, request, output, _logger); if (cfg.Connections.First(c => c.Name == "output").Provider == "internal") { // nothing to init, so just run in default mode return(new FileImportResult { Information = fileInformation, Rows = ProcessFactory.CreateSingle(cfg, _logger).Execute() }); } // first run in init mode cfg.Mode = "init"; var process = ProcessFactory.CreateSingle(cfg, _logger, new Options { Mode = "init" }); process.ExecuteScaler(); // now run in default mode cfg.Mode = "default"; process = ProcessFactory.CreateSingle(cfg, _logger, new Options() { Mode = "default" }); return(new FileImportResult { Information = fileInformation, Rows = process.Execute(), RowCount = process.Entities[0].Inserts }); }
public ConnectionBuilder Connection(string name) { if (_process.Connections.Any(c => c.Name == name)) { return new ConnectionBuilder(this, _process.Connections.First(c => c.Name == name)); } var connection = new TflConnection { Name = name }.WithDefaults(); _process.Connections.Add(connection); return new ConnectionBuilder(this, connection); }
public SqlCeConnection(TflConnection element, AbstractConnectionDependencies dependencies) : base(element, dependencies) { Type = ProviderType.SqlCe4; L = "["; R = "]"; IsDatabase = true; ConnectionStringProperties.ServerProperty = "Data Source"; ConnectionStringProperties.PersistSecurityInfoProperty = "Persist Security Info"; }
public ConnectionBuilder Connection(TflConnection connection) { var name = connection.Name; if (_process.Connections.Any(c => c.Name == name)) { var cn = _process.Connections.First(c => c.Name == name); _process.Connections.Remove(cn); _process.Connections.Add(connection); return new ConnectionBuilder(this, connection); } _process.Connections.Add(connection); return new ConnectionBuilder(this, connection); }
public SolrConnection(TflConnection element, AbstractConnectionDependencies dependencies) : base(element, dependencies) { Type = ProviderType.Solr; IsDatabase = true; TextQualifier = string.Empty; _solrUrl = element.NormalizeUrl(DEFAULT_PORT); if (!element.File.Equals(string.Empty)) { _schemaFile = element.File; } }
public MySqlConnection(TflConnection element, AbstractConnectionDependencies dependencies) : base(element, dependencies) { Type = ProviderType.MySql; L = "`"; R = "`"; TextQualifier = "'"; IsDatabase = true; Views = true; ConnectionStringProperties.UserProperty = "Uid"; ConnectionStringProperties.PasswordProperty = "Pwd"; ConnectionStringProperties.PortProperty = "Port"; ConnectionStringProperties.DatabaseProperty = "Database"; ConnectionStringProperties.ServerProperty = "Server"; }
public ConnectionBuilder Connection(TflConnection connection) { var name = connection.Name; if (_process.Connections.Any(c => c.Name == name)) { var cn = _process.Connections.First(c => c.Name == name); _process.Connections.Remove(cn); _process.Connections.Add(connection); return(new ConnectionBuilder(this, connection)); } _process.Connections.Add(connection); return(new ConnectionBuilder(this, connection)); }
private void ProcessConnectionString(TflConnection element) { if (element.ConnectionString != string.Empty) { Database = ConnectionStringParser.GetDatabaseName(element.ConnectionString); Server = ConnectionStringParser.GetServerName(element.ConnectionString); User = ConnectionStringParser.GetUsername(element.ConnectionString); Password = ConnectionStringParser.GetPassword(element.ConnectionString); PersistSecurityInfo = ConnectionStringParser.GetPersistSecurityInfo(element.ConnectionString); } else { Server = element.Server; Database = element.Database; User = element.User; Password = element.Password; Port = element.Port; } }
/* Pooling=true;Min Pool Size=0;Max Pool Size=100;Connection Lifetime=0; */ public PostgreSqlConnection(TflConnection element, AbstractConnectionDependencies dependencies) : base(element, dependencies) { Type = ProviderType.PostgreSql; L = "\""; R = "\""; TextQualifier = "'"; IsDatabase = true; InsertMultipleRows = true; Views = true; Schemas = true; DefaultSchema = "public"; ConnectionStringProperties.UserProperty = "User ID"; ConnectionStringProperties.PasswordProperty = "Password"; ConnectionStringProperties.PortProperty = "Port"; ConnectionStringProperties.DatabaseProperty = "Database"; ConnectionStringProperties.ServerProperty = "Host"; NoLock = false; }
protected AbstractConnection(TflConnection element, AbstractConnectionDependencies dependencies) { Source = element; BatchSize = element.BatchSize; Name = element.Name; Start = element.Start; End = element.End; File = element.File; Folder = element.Folder; Delimiter = element.Delimiter == string.Empty ? default(char) : element.Delimiter[0]; DateFormat = element.DateFormat; Header = element.Header; Footer = element.Footer; EnableSsl = element.EnableSsl; Direct = element.Direct; Encoding = element.Encoding; Version = element.Version; CheckMe = element.Check; Path = element.Path; ErrorMode = (ErrorMode)Enum.Parse(typeof(ErrorMode), element.ErrorMode, true); SearchOption = (SearchOption)Enum.Parse(typeof(SearchOption), element.SearchOption, true); SearchPattern = element.SearchPattern; ProcessConnectionString(element); TableQueryWriter = dependencies.TableQueryWriter; ConnectionChecker = dependencies.ConnectionChecker; EntityRecordsExist = dependencies.EntityRecordsExist; EntityDropper = dependencies.EntityDropper; EntityCreator = dependencies.EntityCreator; ViewWriters = dependencies.ViewWriters; TflWriter = dependencies.TflWriter; ScriptRunner = dependencies.ScriptRunner; DataTypeService = dependencies.DataTypeService; Logger = dependencies.Logger; Is = new ConnectionIs(this); }
private static TflProcess BuildProcess( FileInformation fileInformation, FileInspectionRequest request, TflConnection output, ILogger logger) { var process = new TflRoot().GetDefaultOf <TflProcess>(p => { p.Name = request.EntityName; p.Star = request.ProcessName; p.StarEnabled = false; p.ViewEnabled = false; p.PipelineThreading = "MultiThreaded"; p.Connections = new List <TflConnection> { p.GetDefaultOf <TflConnection>(c => { c.Name = "input"; c.Provider = "file"; c.File = fileInformation.FileInfo.FullName; c.Delimiter = fileInformation.Delimiter == default(char) ? "|" : fileInformation.Delimiter.ToString(CultureInfo.InvariantCulture); c.Start = fileInformation.FirstRowIsHeader ? 2 : 1; }), output }; p.Entities = new List <TflEntity> { p.GetDefaultOf <TflEntity>(e => { e.Name = request.EntityName; e.Connection = "input"; e.PrependProcessNameToOutputName = false; e.DetectChanges = false; e.Fields = GetFields(p, new FieldInspector(logger).Inspect(fileInformation, request), logger, request.EntityName); }) }; }); return(process); }
public FolderConnection(TflConnection element, AbstractConnectionDependencies dependencies) : base(element, dependencies) { Type = ProviderType.Folder; }
public WebConnection(TflConnection element, AbstractConnectionDependencies dependencies) : base(element, dependencies) { _element = element; Type = ProviderType.Web; }
public LogConnection(TflConnection element, AbstractConnectionDependencies dependencies) : base(element, dependencies) { Type = ProviderType.Log; }
public ConnectionBuilder(ProcessBuilder processBuilder, TflConnection connection) { _processBuilder = processBuilder; _connection = connection; }
public ConsoleConnection(TflConnection element, AbstractConnectionDependencies dependencies) : base(element, dependencies) { Type = ProviderType.Console; }
public ConnectionBuilder(ProcessBuilder processBuilder, TflConnection connection) { _processBuilder = processBuilder; _connection = connection; }
public InternalConnection(TflConnection element, AbstractConnectionDependencies dependencies) : base(element, dependencies) { Type = ProviderType.Internal; }
public ConnectionBuilder Connection(TflConnection element) { return(_processBuilder.Connection(element)); }
public ConnectionBuilder Connection(TflConnection element) { return _processBuilder.Connection(element); }
/// <summary> /// Imports a file to an output with default file inspection settings /// </summary> /// <param name="fileName"></param> /// <param name="output"></param> /// <returns></returns> public long ImportScaler(string fileName, TflConnection output) { return(ImportScaler(new FileInspectionRequest(fileName), output)); }
/// <summary> /// Imports a file to an output with provided file inpections settings /// </summary> /// <param name="request"></param> /// <param name="output"></param> /// <returns></returns> public long ImportScaler(FileInspectionRequest request, TflConnection output) { return(Import(request, output).RowCount); }
public FileImportResult Import(string fileName, TflConnection output) { return(Import(new FileInspectionRequest(fileName), output)); }