{"id":16431788,"url":"https://github.com/drkostas/high-sql","last_synced_at":"2025-10-14T07:03:58.443Z","repository":{"id":57437314,"uuid":"452461123","full_name":"drkostas/high-sql","owner":"drkostas","description":"A high-level sql command utility. Currently only MySQL is supported.","archived":false,"fork":false,"pushed_at":"2022-01-30T01:42:28.000Z","size":31,"stargazers_count":29,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-12T08:32:29.158Z","etag":null,"topics":["db-connection","db-connector","db-utils","mysql-connector","sql-query"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/high-sql/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drkostas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-26T22:26:20.000Z","updated_at":"2024-10-07T01:09:46.000Z","dependencies_parsed_at":"2022-09-11T03:23:07.723Z","dependency_job_id":null,"html_url":"https://github.com/drkostas/high-sql","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drkostas%2Fhigh-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drkostas%2Fhigh-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drkostas%2Fhigh-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drkostas%2Fhigh-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drkostas","download_url":"https://codeload.github.com/drkostas/high-sql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221811344,"owners_count":16884305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["db-connection","db-connector","db-utils","mysql-connector","sql-query"],"created_at":"2024-10-11T08:32:33.555Z","updated_at":"2025-10-14T07:03:58.352Z","avatar_url":"https://github.com/drkostas.png","language":"Python","readme":"# High SQL\n\n[![Downloads](https://static.pepy.tech/personalized-badge/high-sql?period=total\u0026units=international_system\u0026left_color=grey\u0026right_color=red\u0026left_text=Downloads)](https://pepy.tech/project/high-sql)\n[![GitHub license](https://img.shields.io/badge/license-Apache-blue.svg)](https://github.com/drkostas/high-sql/blob/master/LICENSE)\n[![CircleCI](https://circleci.com/gh/drkostas/high-sql/tree/master.svg?style=svg)](https://circleci.com/gh/drkostas/high-sql/tree/master)\n\n## About \u003ca name = \"about\"\u003e\u003c/a\u003e\n\nA high-level sql command utility. Currently, only MySQL is\nsupported. [PYPI Package](https://pypi.org/project/high-sql/)\n\n## Table of Contents\n\n+ [Using the library](#using)\n    + [Installing and using the library](#install_use)\n    + [Examples of usage](#examples)\n+ [Manually install the library](#manual_install)\n    + [Prerequisites](#prerequisites)\n    + [Install the requirements](#installing_req)\n    + [Run the Unit Tests](#unit_tests)\n+ [Continuous Integration](#ci)\n+ [Update PyPI package](#pypi)\n+ [License](#license)\n\n## Using the library \u003ca name = \"using\"\u003e\u003c/a\u003e\n\nFor a detailed usage example see \n[example.py](https://github.com/drkostas/high-sql/tree/master/example.py).\n\n### Installing and using the library \u003ca name = \"install_use\"\u003e\u003c/a\u003e\n\nFirst, you need to install the library using pip:\n\n```shell\n$ pip install high_sql\n```\n\nThen, import it and initialize it like so:\n\n```python\nfrom high_sql import HighMySQL\n\ndb_conf = {'hostname': 'your hostname', 'username': 'your username', 'password': 'your password',\n           'db_name': 'your db name', 'port': 3306}\nmysql_obj = HighMySQL(config=db_conf)\n```\n\nIf you want to use a yml file to load the configuration, you can use the `HighConfig` class:\n```python\nfrom high_sql import HighConfig\nimport os\n\nconfig_path = str(os.path.join('confs', 'conf.yml'))\nconfig = HighConfig(config_src=config_path)\ndb_conf = config.get_db_config()\n```\n\nTwo example YAML files can be found in \nthe [confs folder](https://github.com/drkostas/high-sql/blob/master/confs).\nFor more details on how to use this YAML configuration loader see \nthis [Readme](https://github.com/drkostas/yaml-config-wrapper/blob/master/README.md).\n\n### Examples of usage \u003ca name = \"examples\"\u003e\u003c/a\u003e\n\nThe currently supported operations are the following:\n- Inserts, Updates, Deletes, Select\n- Create, Truncate, Drop table\n- Show all tables\n\n**Insert**\n```python\nmysql_obj.insert_into_table('test_table', data={'firstname': 'Mr Name', 'lastname': 'surname'})\n```\n**Update**\n```python\nmysql_obj.update_table('test_table', set_data={'lastname': 'New Last Name'},\n                       where='firstname=\"Mr Name\"')\n```\n**Delete**\n```python\nmysql_obj.delete_from_table('test_table', where='firstname=\"Mr Name\"')\n```\n**Select**\n```python\nres = mysql_obj.select_from_table('test_table', columns='*', where='firstname=\"Mr Name\"', \n                                  order_by='firstname', asc_or_desc='ASC', limit=5)\n```\n**Truncate**\n```python\nmysql_obj.truncate_table('test_table')\n```\n**Create**\n```python\nmysql_obj.create_table(table='test_table', schema=table_schema)\n```\n**Drop**\n```python\nmysql_obj.drop_table('test_table')\n```\n**Show Tables**\n```python\nmysql_obj.show_tables()\n```\n\nAll of these examples can be found \nin [example.py](https://github.com/drkostas/high-sql/tree/master/example.py).\n\n## Manually install the library \u003ca name = \"manual_install\"\u003e\u003c/a\u003e\n\nThese instructions will get you a copy of the project up and running on your local machine for\ndevelopment and testing purposes.\n\n### Prerequisites \u003ca name = \"prerequisites\"\u003e\u003c/a\u003e\n\nYou need to have a machine with\n[anaconda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) installed and\nany Bash based shell (e.g. zsh) installed.\n\n```ShellSession\n\n$ conda -V\nconda 4.10.1\n\n$ echo $SHELL\n/usr/bin/zsh\n\n```\n\n### Install the requirements \u003ca name = \"installing_req\"\u003e\u003c/a\u003e\n\nAll the installation steps are being handled by\nthe [Makefile](https://github.com/drkostas/high-sql/tree/master/Makefile).\n\nFirst, modify the python version (`min_python`) and everything else you need in\nthe [settings.ini](https://github.com/drkostas/high-sql/tree/master/settings.ini).\n\nThen, execute the following commands:\n\n```ShellSession\n$ make create_env\n$ conda activate high_sql\n$ make dist\n```\n\nNow you are ready to use and modify the library.\n\n### Run the Unit Tests \u003ca name = \"unit_tests\"\u003e\u003c/a\u003e\n\nIf you want to run the unit tests, execute the following command:\n\n```ShellSession\n$ make tests\n```\n\n## Continuous Integration \u003ca name = \"ci\"\u003e\u003c/a\u003e\n\nFor the continuous integration, the \u003cb\u003eCircleCI\u003c/b\u003e service is being used. For more information you can\ncheck the [setup guide](https://circleci.com/docs/2.0/language-python/).\n\nFor any modifications, edit\nthe [circleci config](https://github.com/drkostas/high-sql/tree/master/.circleci/config.yml).\n\n## Update PyPI package \u003ca name = \"pypi\"\u003e\u003c/a\u003e\n\nThis is mainly for future reference for the developers of this project. First,\ncreate a file called `~/.pypirc` with your pypi login details, as follows:\n\n```\n[pypi]\nusername = your_pypi_username\npassword = your_pypi_password\n```\n\nThen, modify the python version (`min_python`), project status (`status`), release version (`version`) \nand everything else you need in\nthe [settings.ini](https://github.com/drkostas/high-sql/tree/master/settings.ini).\n\nFinally, execute the following commands:\n\n```ShellSession\n$ make create_env\n$ conda activate high_sql\n$ make release\n```\n\nFor a dev release, change the `testing_version` and instead of `make release`, run `make release_test`.\n\n## License \u003ca name = \"license\"\u003e\u003c/a\u003e\n\nThis project is licensed under the Apache License - see\nthe [LICENSE](https://github.com/drkostas/high-sql/tree/master/LICENSE) file for details.\n\n\u003ca href=\"https://www.buymeacoffee.com/drkostas\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\u003c/a\u003e\n","funding_links":["https://www.buymeacoffee.com/drkostas"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrkostas%2Fhigh-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrkostas%2Fhigh-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrkostas%2Fhigh-sql/lists"}