{"id":16135292,"url":"https://github.com/xnuinside/sqlalchan","last_synced_at":"2025-04-06T16:18:15.417Z","repository":{"id":116643798,"uuid":"201740771","full_name":"xnuinside/sqlalchan","owner":"xnuinside","description":"Customising SQLALchemy' Class definition with inheriting from DeclarativeMeta Class.  ","archived":false,"fork":false,"pushed_at":"2020-04-07T09:20:47.000Z","size":14,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T22:17:37.020Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xnuinside.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-11T08:54:31.000Z","updated_at":"2024-12-25T12:06:46.000Z","dependencies_parsed_at":"2023-03-13T12:57:02.722Z","dependency_job_id":null,"html_url":"https://github.com/xnuinside/sqlalchan","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"3b254c6dca2ab3b41a4c6c8bec474812d7765e39"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xnuinside%2Fsqlalchan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xnuinside%2Fsqlalchan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xnuinside%2Fsqlalchan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xnuinside%2Fsqlalchan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xnuinside","download_url":"https://codeload.github.com/xnuinside/sqlalchan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509241,"owners_count":20950232,"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":[],"created_at":"2024-10-09T23:06:48.197Z","updated_at":"2025-04-06T16:18:15.392Z","avatar_url":"https://github.com/xnuinside.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Toy-example how possible to customize SQLAlchemy Class definition and mapping your custom metaclass that inherit from SQLAlchemy DeclarativeMeta Class. \n\nIn example, we use simple class annotations to define tables, instead of huge classical SQLAlchemy classes. \n\nThis: \n    from sqlalchemy import Column, Integer, String\n\n    class User(Base):\n         __tablename__ = 'users'\n    \n         id = Column(Integer, primary_key=True)\n         name = Column(String)\n         fullname = Column(String)\n         nickname = Column(String)\n\n\n\nBecame this: \n\n    class User(Base):\n\n        id: int\n        name: str\n        fullname: str\n        nickname: str\n\nExamples in **'examples'** dir.\nMain code in **'base_meta.py'**\n\n\n###  How to run example: \n\n1. git clone this repo to your local machine\n2. go to sources \n3. run:\n    \n    docker-compose -f test_docker_compose.yml up postgres_test\n    \n4. wait until DB will success created\n    \n5. In new terminal window run: \n    \n    docker-compose -f test_docker_compose.yml up main\n\n6. If you want to test insert - uncomment lines in 'db.py'\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxnuinside%2Fsqlalchan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxnuinside%2Fsqlalchan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxnuinside%2Fsqlalchan/lists"}