Skip to main content

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/

Metadata

Release files for gesang-sqlalchemy 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gesang-sqlalchemy 1.0.0
File Size Uploaded
gesang-sqlalchemy-1.0.0.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gesang-sqlalchemy 1.0.0
File Interpreter ABI Platform
gesang_sqlalchemy-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.7 kB

Release files / gesang-sqlalchemy-1.0.0.tar.gz

Download URL gesang-sqlalchemy-1.0.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2352c390fdeb53120a8256940e53afae07d6174b1daafff60528544957157d4d
BLAKE2b-256 checksum
How to use checksums
71b6f1cc61a40cef493f66cdbbcbf57fb5c77a3dc0faac873f29829901bac1f1
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / gesang_sqlalchemy-1.0.0-py3-none-any.whl

Download URL gesang_sqlalchemy-1.0.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0603cd5b94fe5e8c861af02b04d0f45408196e2582a4af4c618e17910f9d086e
BLAKE2b-256 checksum
How to use checksums
75c989debea1ca8d2c77c0f56a1f8b7692b7938dd39ea29e1212a6587062be45
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page