Beispiel #1
0
        private string BuildConnectionString(Connection parmList)
        {
            var csItems = ClassToDictionary(parmList);

            SnowflakeDbConnectionStringBuilder csb = new SnowflakeDbConnectionStringBuilder();

            foreach (KeyValuePair <string, string> item in csItems)
            {
                csb.Add(item.Key, item.Value);
            }

            return(csb.ConnectionString);
        }
Beispiel #2
0
        public override string GetConnectionString(string databaseName)
        {
            var connectionString = EnvironmentHelper.GetEnvironmentVariable("YUNIQL_TEST_CONNECTION_STRING");

            if (string.IsNullOrEmpty(connectionString))
            {
                throw new ApplicationException("Missing environment variable YUNIQL_TEST_CONNECTION_STRING. See WIKI for developer guides.");
            }

            //extract the default database name from connection string and replaced with test database name
            var connectionStringBuilder = new SnowflakeDbConnectionStringBuilder();

            connectionStringBuilder.ConnectionString = connectionString;
            connectionStringBuilder.Remove("db");
            connectionStringBuilder.Add("db", databaseName.DoubleQuote());
            return(connectionStringBuilder.ConnectionString);
        }