/// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override List <TableInfo> GetTableInfos()
        {
            MySqlTableManager.InitializeTables();
            MySqlColumnManager.InitializeColumns();
            MySqlPrimaryKeyManager.InitializePrimaryKeys();
            MySqlForeignKeyManager.InitializeForeignKeys();

            var postgresTables = MySqlTableManager.GetTables();

            _tableInfos = postgresTables.Select(ConvertToTableInfo).ToList();
            _tableInfos.ForEach(FillForeignKeyInfos);

            return(_tableInfos);
        }
        /// <summary>
        ///
        /// </summary>
        public override void Initialize()
        {
            DatabaseConnection = ServicesContainer.GetService <IDatabaseConnection>();
            var namingManager = ServicesContainer.GetService <INamingManager>();

            namingManager.ForeignKeyNamingManager = new MySqlForeignKeyNamingManager();
            namingManager.PrimaryKeyNamingManager = new MySqlPrimaryKeyNamingManager();
            namingManager.UniqueKeyNamingManager  = new MySqlUniqueKeyNamingManager();

            MySqlTableManager      = new MySqlTableManager(this);
            MySqlColumnManager     = new MySqlColumnManager(this);
            MySqlPrimaryKeyManager = new MySqlPrimaryKeyManager(this);
            MySqlForeignKeyManager = new MySqlForeignKeyManager(this);
            DefaultSchema          = GetDatabaseName();
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="table"></param>
        /// <param name="postgresTable"></param>
        /// <returns></returns>
        private PrimaryKeyInfo GetPrimaryKeyInfo(TableInfo table, MySqlTable postgresTable)
        {
            var sqlPrimaryKey = MySqlPrimaryKeyManager.GetPrimaryKey(postgresTable);

            if (sqlPrimaryKey == null)
            {
                return(null);
            }

            var primaryKey = new PrimaryKeyInfo();

            primaryKey.Name          = sqlPrimaryKey.ConstraintName;
            primaryKey.Table         = table;
            primaryKey.PrimaryColumn = table.GetColumn(sqlPrimaryKey.ColumnName);
            return(primaryKey);
        }