# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['dbt',
 'dbt.adapters.mysql',
 'dbt.adapters.mysql5',
 'dbt.include.mysql',
 'dbt.include.mysql5']

package_data = \
{'': ['*'],
 'dbt.include.mysql': ['macros/*',
                       'macros/materializations/incremental/*',
                       'macros/materializations/seed/*',
                       'macros/materializations/snapshot/*',
                       'macros/materializations/table/*'],
 'dbt.include.mysql5': ['macros/*',
                        'macros/materializations/seed/*',
                        'macros/materializations/snapshot/*']}

install_requires = \
['dbt-core==0.19.0', 'mysql-connector-python>=8.0.22,<8.1.0', 'wrapt==1.13.3']

setup_kwargs = {
    'name': 'dbt-mysql-adapter',
    'version': '0.19.0',
    'description': 'The MySQL adapter plugin for dbt (data build tool)',
    'long_description': '# dbt-mysql-adapter\n\nThis is a maintained fork of the [dbt-mysql](https://github.com/dbeatty10/dbt-mysql) project.\n\nThis plugin ports [dbt](https://getdbt.com) functionality to MySQL.\n\nThis is an experimental plugin:\n- We have not tested it extensively\n- Storage engines other than the default of InnoDB are untested\n- MariaDB compatibility is untested\n- Only tested with [dbt-adapter-tests](https://github.com/fishtown-analytics/dbt-adapter-tests) with MySQL 5.6, 5.7, and 8.0\n- Compatiblity with other [dbt packages](https://hub.getdbt.com/) (like [dbt_utils](https://hub.getdbt.com/fishtown-analytics/dbt_utils/latest/)) is also untested\n\nPlease read these docs carefully and use at your own risk. [Issues](https://github.com/julianopiovezan/dbt-mysql-adapter/issues/new) and [PRs](https://github.com/julianopiovezan/dbt-mysql-adapter/blob/main/CONTRIBUTING.rst#contributing) welcome!\n\nTable of Contents\n=================\n\n   * [Installation](#installation)\n   * [Supported features](#supported-features)\n      * [MySQL 8.0](#mysql-80)\n      * [MySQL 5.6 and 5.7](#mysql-56-and-57)\n         * [MySQL 5.6 configuration gotchas](#mysql-56-configuration-gotchas)\n         * [MySQL 5.7 configuration gotchas](#mysql-57-configuration-gotchas)\n   * [Configuring your profile](#configuring-your-profile)\n   * [Notes](#notes)\n   * [Running Tests](#running-tests)\n   * [Reporting bugs and contributing code](#reporting-bugs-and-contributing-code)\n\n### Installation\nThis plugin can be installed via pip:\n\n```bash\n$ pip install dbt-mysql\n```\n\n### Supported features\n\n| 5.6 / 5.7 | 8.0 | Feature                     |\n|:---------:|:---:|-----------------------------|\n|     ✅     |  ✅  | Table materialization       |\n|     ✅     |  ✅  | View materialization        |\n|     ✅     |  ✅  | Incremental materialization |\n|     ❌     |  ✅  | Ephemeral materialization   |\n|     ✅     |  ✅  | Seeds                       |\n|     ✅     |  ✅  | Sources                     |\n|     ✅     |  ✅  | Custom data tests           |\n|     ✅     |  ✅  | Docs generate               |\n|     🤷     |  ✅  | Snapshots                   |\n\nNotes:\n- Ephemeral materializations rely upon [Common Table Expressions](https://en.wikipedia.org/wiki/Hierarchical_and_recursive_queries_in_SQL) (CTEs), which are not supported until MySQL 8.0\n- MySQL 5.6 and 5.7 have some configuration gotchas that affect snapshots (see below).\n\n##### MySQL 5.6 configuration gotchas\n\ndbt snapshots might not work properly due to [automatic initialization and updating for `TIMESTAMP`](https://dev.mysql.com/doc/refman/5.6/en/timestamp-initialization.html) if:\n- the output of `SHOW VARIABLES LIKE \'sql_mode\'` includes `NO_ZERO_DATE`\n- the output of `SHOW GLOBAL VARIABLES LIKE \'explicit_defaults_for_timestamp\'` has a value of `OFF`\n\nA solution is to include the following in a `*.cnf` file:\nConfiguration to include in a `*.cnf` file:\n```\n[mysqld]\nexplicit_defaults_for_timestamp = true\n```\n\n##### MySQL 5.7 configuration gotchas\n\ndbt snapshots might not work properly due to [automatic initialization and updating for `TIMESTAMP`](https://dev.mysql.com/doc/refman/5.7/en/timestamp-initialization.html) if:\ndbt snapshots might not work properly if:\n- the output of `SHOW VARIABLES LIKE \'sql_mode\'` includes `NO_ZERO_DATE`\n\nA solution is to include the following in a `*.cnf` file:\nConfiguration to include in a `*.cnf` file:\n```\n[mysqld]\nexplicit_defaults_for_timestamp = true\nsql_mode = "ALLOW_INVALID_DATES,{other_sql_modes}"\n```\nwhere `{other_sql_modes}` is the rest of the modes from the `SHOW VARIABLES LIKE \'sql_mode\'` output.\n\n### Configuring your profile\n\nA dbt profile can be configured to run against MySQL using the following configuration example:\n\nUse `type: mysql` for MySQL 8.x and `type: mysql5` for MySQL 5.x\n\n**Example entry for profiles.yml:**\n\n```\nyour_profile_name:\n  target: dev\n  outputs:\n    dev:\n      type: mysql\n      server: localhost\n      port: 3306\n      schema: analytics\n      username: your_mysql_username\n      password: your_mysql_password\n```\n\n| Option          | Description                                                                         | Required?                                                          | Example                                        |\n| --------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------ | ---------------------------------------------- |\n| type            | The specific adapter to use                                                         | Required                                                           | `mysql` or `mysql5`                            |\n| server          | The server (hostname) to connect to                                                 | Required                                                           | `yourorg.mysqlhost.com`                        |\n| port            | The port to use                                                                     | Optional                                                           | `3306`                                         |\n| schema          | Specify the schema (database) to build models into                                  | Required                                                           | `analytics`                                    |\n| username        | The username to use to connect to the server                                        | Required                                                           | `dbt_admin`                                    |\n| password        | The password to use for authenticating to the server                                | Required                                                           | `correct-horse-battery-staple`                 |\n\n### Notes\n\nConflicting terminology is used between:\n- dbt\n- Database management systems (DBMS) like MySQL, Postgres, and Snowflake\n- metadata in the ANSI-standard `information_schema`\n\nThe conflicts include both:\n- the same word meaning different things\n- different words meaning the same thing\n\nFor example, a "database" in MySQL is not the same as a "database" in dbt, but it is equivalent to a "schema" in Postgres 🤯.\n\ndbt-mysql-adapter uses the dbt terms. The native MySQL verbiage is restricted to SQL statements.\n\nThis cross-walk aligns the terminology:\n\n| information_schema    | dbt (and Postgres)           | MySQL                            |\n| --------------------- | ---------------------------- | -------------------------------- |\n| catalog               |  database                    | _undefined / not implemented_    |\n| schema                |  schema                      | database                         |\n| relation (table/view) |  relation (table/view)       | relation (table/view)            |\n| column                |  column                      | column                           |\n\nAdditionally, many DBMS have relation names with three parts whereas MySQL has only two. E.g., a fully-qualified table name in Postgres is `database.schema.table` versus `database.table` in MySQL. The missing part in MySQL is the `information_schema` "catalog".\n\n| DBMS               | Fully-qualified relation name | Parts      |\n| ------------------ | ----------------------------- | ---------- |\n| Postgres           |  `database.schema.table`      | 3          |\n| MySQL              |  `database.table`             | 2          |\n\n### Running Tests\n\nSee [test/README.md](test/README.md) for details on running the integration tests.\n\n### Reporting bugs and contributing code\n\n-   Want to report a bug or request a feature? See the [contributing guidelines](https://github.com/julianopiovezan/dbt-mysql-adapter/blob/main/CONTRIBUTING.rst#contributing), or open [an issue](https://github.com/julianopiovezan/dbt-mysql-adapter/issues/new).\n\n### Credits\n\ndbt-mysql-adapter borrows from [dbt-spark](https://github.com/fishtown-analytics/dbt-spark) and [dbt-sqlite](https://github.com/codeforkjeff/dbt-sqlite) since Spark and SQLite also use two-part relation names.\n',
    'author': 'Juliano Benvenuto Piovezan',
    'author_email': 'piovezan.juliano@gmail.com',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://github.com/julianopiovezan/dbt-mysql-adapter',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.6.3',
}


setup(**setup_kwargs)
