<p align="center">
<img src="https://raw.githubusercontent.com/dbt-labs/dbt/ec7dee39f793aa4f7dd3dae37282cc87664813e4/etc/dbt-logo-full.svg" alt="dbt logo" width="500"/>
</p>
<p align="center">
<a href="https://github.com/dbt-labs/dbt-core/actions/workflows/main.yml">
<img src="https://github.com/dbt-labs/dbt-core/actions/workflows/main.yml/badge.svg?event=push" alt="CI Badge"/>
</a>
</p>
**[dbt](https://www.getdbt.com/)** enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications.
dbt is the T in ELT. Organize, cleanse, denormalize, filter, rename, and pre-aggregate the raw data in your warehouse so that it's ready for analysis.
## dbt-gaussdbdws
The `dbt-gaussdbdws` package contains all of the code enabling dbt to work with huawei gaussdb or gaussdb(dws) database. For
more information on using dbt with dbt-gaussdbdws, consult [the docs](https://docs.getdbt.com/docs/profile-gaussdbdws).
## Getting started
- [Install dbt](https://docs.getdbt.com/docs/installation)
- Read the [introduction](https://docs.getdbt.com/docs/introduction/) and [viewpoint](https://docs.getdbt.com/docs/about/viewpoint/)
### `psycopg2-binary` vs. `psycopg2`
By default, `dbt-gaussdbdws` installs `psycopg2-binary`. This is great for development, and even testing, as it does not require any OS dependencies; it's a pre-built wheel. However, building `psycopg2` from source will grant performance improvements that are desired in a production environment. In order to install `psycopg2`, use the following steps:
```bash
if [[ $(pip show psycopg2-binary) ]]; then
PSYCOPG2_VERSION=$(pip show psycopg2-binary | grep Version | cut -d " " -f 2)
pip uninstall -y psycopg2-binary
pip install psycopg2==$PSYCOPG2_VERSION
fi
```
This ensures the version of `psycopg2` will match that of `psycopg2-binary`.
**Note:** The native PostgreSQL driver cannot connect to GaussDB directly. If you need to use the PostgreSQL native driver, you must set `password_encryption_type: 1` (compatibility mode supporting both MD5 and SHA256) to enable the PostgreSQL native driver.
### `GaussDB psycopg2`
It is recommended to use the following approach: GaussDB uses SHA256 as the default encryption method for user passwords, while the PostgreSQL native driver defaults to MD5 for password encryption. Follow the steps below to prepare the required drivers and dependencies and load the driver.
1.You can obtain the required package from the release bundle. The package is named as:
`GaussDB-Kernel_<database_version>_<OS_version>_64bit_Python.tar.gz`.
- psycopg2:Contains the psycopg2 library files.
- lib:Contains the psycopg2 library files.
2.Follow the steps below to load the driver:
```bash
# Extract the driver package, for example: GaussDB-Kernel_xxx.x.x_Hce_64bit_Python.tar.gz
tar -zxvf GaussDB-Kernel_xxx.x.x_Hce_64bit_Python.tar.gz
# Uninstall psycopg2-binary
pip uninstall -y psycopg2-binary
# Install psycopg2 by copying it to the site-packages directory of the Python installation using the root user
cp psycopg2 $(python3 -c 'import site; print(site.getsitepackages()[0])') -r
# Grant permissions
chmod 755 $(python3 -c 'import site; print(site.getsitepackages()[0])')/psycopg2 -R
# Verify the existence of the psycopg2 directory
ls -ltr $(python3 -c 'import site; print(site.getsitepackages()[0])') | grep psycopg2
# To add the psycopg2 directory to the $PYTHONPATH environment variable and make it effective
export PYTHONPATH=$(python3 -c 'import site; print(site.getsitepackages()[0])'):$PYTHONPATH
# For non-database users, you need to add the extracted lib directory to the LD_LIBRARY_PATH environment variable
export LD_LIBRARY_PATH=/root/lib:$LD_LIBRARY_PATH
# To verify that the configuration is correct and there are no errors
(.venv) [root@ecs-euleros-dev ~]# python3
Python 3.9.9 (main, Jun 19 2024, 02:50:21)
[GCC 10.3.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
```
## Contribute
See `CONTRIBUTING.md` for a detailed overview of contributing a code change to this adapter.
## Join the dbt Community
- Be part of the conversation in the [dbt Community Slack](http://community.getdbt.com/)
- Read more on the [dbt Community Discourse](https://discourse.getdbt.com)
## Reporting bugs and contributing code
- Want to report a bug or request a feature? Let us know on [Slack](http://community.getdbt.com/), or open [an issue](https://github.com/dbt-labs/dbt-gaussdbdws/issues/new)
- Want to help us build dbt? Check out the [Contributing Guide](https://github.com/dbt-labs/dbt-gaussdbdws/blob/main/CONTRIBUTING.md)
## Code of Conduct
Everyone interacting in the dbt project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [dbt Code of Conduct](https://community.getdbt.com/code-of-conduct).
Raw data
{
"_id": null,
"home_page": null,
"name": "dbt-gaussdbdws",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9.0",
"maintainer_email": "dbt Labs <info@dbtlabs.com>",
"keywords": "adapter, adapters, database, dbt, dbt Cloud, dbt Core, dbt Labs, dbt-core, elt, gaussdb(DWS)",
"author": null,
"author_email": "dbt Labs <info@dbtlabs.com>",
"download_url": "https://files.pythonhosted.org/packages/1c/8b/35652481363420abcf3b9b9d52930ec1a94b209d1803b0d78e63a1185179/dbt_gaussdbdws-1.0.1.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n <img src=\"https://raw.githubusercontent.com/dbt-labs/dbt/ec7dee39f793aa4f7dd3dae37282cc87664813e4/etc/dbt-logo-full.svg\" alt=\"dbt logo\" width=\"500\"/>\n</p>\n<p align=\"center\">\n <a href=\"https://github.com/dbt-labs/dbt-core/actions/workflows/main.yml\">\n <img src=\"https://github.com/dbt-labs/dbt-core/actions/workflows/main.yml/badge.svg?event=push\" alt=\"CI Badge\"/>\n </a>\n</p>\n\n**[dbt](https://www.getdbt.com/)** enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications.\n\ndbt is the T in ELT. Organize, cleanse, denormalize, filter, rename, and pre-aggregate the raw data in your warehouse so that it's ready for analysis.\n\n## dbt-gaussdbdws\n\nThe `dbt-gaussdbdws` package contains all of the code enabling dbt to work with huawei gaussdb or gaussdb(dws) database. For\nmore information on using dbt with dbt-gaussdbdws, consult [the docs](https://docs.getdbt.com/docs/profile-gaussdbdws).\n\n## Getting started\n\n- [Install dbt](https://docs.getdbt.com/docs/installation)\n- Read the [introduction](https://docs.getdbt.com/docs/introduction/) and [viewpoint](https://docs.getdbt.com/docs/about/viewpoint/)\n\n### `psycopg2-binary` vs. `psycopg2`\n\nBy default, `dbt-gaussdbdws` installs `psycopg2-binary`. This is great for development, and even testing, as it does not require any OS dependencies; it's a pre-built wheel. However, building `psycopg2` from source will grant performance improvements that are desired in a production environment. In order to install `psycopg2`, use the following steps:\n\n```bash\nif [[ $(pip show psycopg2-binary) ]]; then\n PSYCOPG2_VERSION=$(pip show psycopg2-binary | grep Version | cut -d \" \" -f 2)\n pip uninstall -y psycopg2-binary\n pip install psycopg2==$PSYCOPG2_VERSION\nfi\n```\n\nThis ensures the version of `psycopg2` will match that of `psycopg2-binary`.\n**Note:** The native PostgreSQL driver cannot connect to GaussDB directly. If you need to use the PostgreSQL native driver, you must set `password_encryption_type: 1` (compatibility mode supporting both MD5 and SHA256) to enable the PostgreSQL native driver.\n\n### `GaussDB psycopg2`\nIt is recommended to use the following approach: GaussDB uses SHA256 as the default encryption method for user passwords, while the PostgreSQL native driver defaults to MD5 for password encryption. Follow the steps below to prepare the required drivers and dependencies and load the driver.\n\n1.You can obtain the required package from the release bundle. The package is named as:\n`GaussDB-Kernel_<database_version>_<OS_version>_64bit_Python.tar.gz`.\n- psycopg2\uff1aContains the psycopg2 library files.\n- lib\uff1aContains the psycopg2 library files.\n\n2.Follow the steps below to load the driver:\n```bash\n# Extract the driver package, for example: GaussDB-Kernel_xxx.x.x_Hce_64bit_Python.tar.gz\ntar -zxvf GaussDB-Kernel_xxx.x.x_Hce_64bit_Python.tar.gz\n\n# Uninstall psycopg2-binary\npip uninstall -y psycopg2-binary\n\n# Install psycopg2 by copying it to the site-packages directory of the Python installation using the root user\ncp psycopg2 $(python3 -c 'import site; print(site.getsitepackages()[0])') -r\n\n# Grant permissions\nchmod 755 $(python3 -c 'import site; print(site.getsitepackages()[0])')/psycopg2 -R\n\n# Verify the existence of the psycopg2 directory\nls -ltr $(python3 -c 'import site; print(site.getsitepackages()[0])') | grep psycopg2\n\n# To add the psycopg2 directory to the $PYTHONPATH environment variable and make it effective\nexport PYTHONPATH=$(python3 -c 'import site; print(site.getsitepackages()[0])'):$PYTHONPATH\n\n# For non-database users, you need to add the extracted lib directory to the LD_LIBRARY_PATH environment variable\nexport LD_LIBRARY_PATH=/root/lib:$LD_LIBRARY_PATH\n\n# To verify that the configuration is correct and there are no errors\n(.venv) [root@ecs-euleros-dev ~]# python3\nPython 3.9.9 (main, Jun 19 2024, 02:50:21)\n[GCC 10.3.1] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import psycopg2\n\n```\n\n\n## Contribute\n\nSee `CONTRIBUTING.md` for a detailed overview of contributing a code change to this adapter.\n\n## Join the dbt Community\n\n- Be part of the conversation in the [dbt Community Slack](http://community.getdbt.com/)\n- Read more on the [dbt Community Discourse](https://discourse.getdbt.com)\n\n## Reporting bugs and contributing code\n\n- Want to report a bug or request a feature? Let us know on [Slack](http://community.getdbt.com/), or open [an issue](https://github.com/dbt-labs/dbt-gaussdbdws/issues/new)\n- Want to help us build dbt? Check out the [Contributing Guide](https://github.com/dbt-labs/dbt-gaussdbdws/blob/main/CONTRIBUTING.md)\n\n## Code of Conduct\n\nEveryone interacting in the dbt project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [dbt Code of Conduct](https://community.getdbt.com/code-of-conduct).\n",
"bugtrack_url": null,
"license": null,
"summary": "The set of adapter protocols and base functionality that supports integration with dbt-core",
"version": "1.0.1",
"project_urls": {
"Changelog": "https://github.com/dbt-labs/dbt-gaussdbdws/blob/main/CHANGELOG.md",
"Documentation": "https://docs.getdbt.com",
"Homepage": "https://github.com/dbt-labs/dbt-gaussdbdws",
"Issues": "https://github.com/dbt-labs/dbt-gaussdbdws/issues",
"Repository": "https://github.com/dbt-labs/dbt-gaussdbdws.git"
},
"split_keywords": [
"adapter",
" adapters",
" database",
" dbt",
" dbt cloud",
" dbt core",
" dbt labs",
" dbt-core",
" elt",
" gaussdb(dws)"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bc676d3251fb524e7d03a76a8a514dc1734948e126accbb7b62ddbb65f00175b",
"md5": "90c37efc83f9b5c4dc2733009ec9aba8",
"sha256": "5b868606eda6a2546d3e7f755350433de5dc294b6a8b55fdca613b9d690f19c8"
},
"downloads": -1,
"filename": "dbt_gaussdbdws-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "90c37efc83f9b5c4dc2733009ec9aba8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9.0",
"size": 36115,
"upload_time": "2024-12-05T06:29:43",
"upload_time_iso_8601": "2024-12-05T06:29:43.819999Z",
"url": "https://files.pythonhosted.org/packages/bc/67/6d3251fb524e7d03a76a8a514dc1734948e126accbb7b62ddbb65f00175b/dbt_gaussdbdws-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1c8b35652481363420abcf3b9b9d52930ec1a94b209d1803b0d78e63a1185179",
"md5": "3d75db4139f28efff9c77dc350d2ff0d",
"sha256": "b49dc44eeb7dc6d524b138fef7d5c680de9975ff167b57b42a3dc1ba1d9e1f47"
},
"downloads": -1,
"filename": "dbt_gaussdbdws-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "3d75db4139f28efff9c77dc350d2ff0d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9.0",
"size": 23814,
"upload_time": "2024-12-05T06:29:45",
"upload_time_iso_8601": "2024-12-05T06:29:45.192212Z",
"url": "https://files.pythonhosted.org/packages/1c/8b/35652481363420abcf3b9b9d52930ec1a94b209d1803b0d78e63a1185179/dbt_gaussdbdws-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-05 06:29:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dbt-labs",
"github_project": "dbt-gaussdbdws",
"github_not_found": true,
"lcname": "dbt-gaussdbdws"
}