Skip to main content

A sql orm framework based on sqlalchemy for gesang api framework.

Project description

flamingo-sqlalchemy

介绍

基于flamingo-core的Sqlalchemy的插件

软件架构

软件架构说明

安装教程

$ pip install gesang-sqlalchemy

使用说明

  1. 配置在项目的PLUGINS中

    PLUGINS = [
        "gesang_sqlalchemy:db"
    ]
    
  2. 代码中ORM

    from gesang_sqlalchemy import db
    from sqlalchemy import Column, BigInteger, String, Boolean, DateTime
    from datetime import datetime
    
    
    class User(db.Model):
        __tablename__ = "user"
        __bind_key__ = "default"
    
        id = Column(BigInteger, primary_key=True)
        username = Column(String(200), nullable=True, unique=True)
        password = Column(String(200), nullable=False)
        valid = Column(Boolean, nullable=True, default=1)
        create_time = Column(DateTime, default=datetime.now)
        update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now)
    
  3. 查询使用

    from gesang_sqlalchemy import db
    from test.models import User
    
    db.session.query(User).filter(User.valid == 1).all()
    

其他SQL详情请见SQLAlchemy , 项目请见Github地址

感谢

  • Flask-Sqlalchemy 感谢此插件的共享提供灵感,项目地址Github地址

ChangeLog

  • 2021-02-09 重命名为gesang-sqlalchemy
  • 2021-02-08 初始版本

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

特技

  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gesang-sqlalchemy-1.0.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

gesang_sqlalchemy-1.0.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file gesang-sqlalchemy-1.0.0.tar.gz.

File metadata

  • Download URL: gesang-sqlalchemy-1.0.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.8

File hashes

Hashes for gesang-sqlalchemy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2352c390fdeb53120a8256940e53afae07d6174b1daafff60528544957157d4d
MD5 4f23c57af03d8b888d32b2bec15afe91
BLAKE2b-256 71b6f1cc61a40cef493f66cdbbcbf57fb5c77a3dc0faac873f29829901bac1f1

See more details on using hashes here.

File details

Details for the file gesang_sqlalchemy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: gesang_sqlalchemy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.8

File hashes

Hashes for gesang_sqlalchemy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0603cd5b94fe5e8c861af02b04d0f45408196e2582a4af4c618e17910f9d086e
MD5 b11a4759d5ff084aa750319bf8bc0f72
BLAKE2b-256 75c989debea1ca8d2c77c0f56a1f8b7692b7938dd39ea29e1212a6587062be45

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page