Ejemplo n.º 1
0
        public void CreateMessageStoreTable()
        {
            using (var connection = new MySqlConnection(_mysqlSettings.TestsBrighterConnectionString))
            {
                _tableName = $"`message_{_tableName}`";
                var createTableSql = MySqlMessageStoreBuilder.GetDDL(_tableName);

                connection.Open();
                using (var command = connection.CreateCommand())
                {
                    command.CommandText = createTableSql;
                    command.ExecuteNonQuery();
                }
            }
        }
Ejemplo n.º 2
0
 private static void CreateMessageTable(string dataSourceTestDb, string tableNameMessages)
 {
     try
     {
         using (var sqlConnection = new MySqlConnection(dataSourceTestDb))
         {
             sqlConnection.Open();
             using (var command = sqlConnection.CreateCommand())
             {
                 command.CommandText = MySqlMessageStoreBuilder.GetDDL(tableNameMessages);
                 command.ExecuteScalar();
             }
         }
     }
     catch (System.Exception e)
     {
         Console.WriteLine($"Issue with creating MessageStore table, {e.Message}");
     }
 }
Ejemplo n.º 3
0
        private static MySqlConnection SetupMessageDb(string connectionStringPath)
        {
            var connectionString = "DataSource=\"" + connectionStringPath + "\"";

            return(CreateDatabaseWithTable(connectionString, MySqlMessageStoreBuilder.GetDDL(TableNameMessages)));
        }