fasva orm是访问fasva中使用的数据库的orm。

fasvaorm的Python项目详细描述


fasva mysql orm

pipelinecoverage

此项目包含一个对象关系映射(orm),用于访问mysql/mariadb 在研究项目中使用FASva使用sqlalchemy。

安装

您可以在PyPi上找到最新版本。

$ pip install fasvaorm

使用量

使用fasvaorm访问数据库非常简单。每个可用表都表示为 在fasvaorm.models模块中初始化。下面是一个关于如何初始化和查询数据库的示例。

fromfasvaormimportinit_engine,get_sessionfromfasvaorm.modelsimportDrive# initialize the engine. Will also try to create the database if it does not exist.engine=init_engine("mysql+pymysql://{user}@{host}:{port}/{database}".format(**dict(user='root',host='localhost',port=3306,database='database')))# now get a sessionsession=get_session()# and use that session to query all available drivesfordinsession.query(Drive).all():print(d.name)# use can also access all records of that driveforrind.records:print(r.filepath)# or the vehicleprint(d.vehicle.serial_number)# or also all scenes of that driveforaind.aggregations:print(a.timestamp)

有关如何使用fasvaorm的更多示例,请参阅tests包。

作者

^{TT5}$(HSELGitHubXINGLinkedInPyPiDocker Hub

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Cassandra docker无法通过JMX连接   java以编程方式在图片模式下启用图片   java访问json数组中的json数组   swing Java 2D API:空指针异常   java Storm 2.0.0内存不足   java为什么Splitter在Spring Integration中处理集合项时直接返回集合?   java Spring启动到Postgres数据库驱动程序问题   java如何将对象围绕其中心旋转90度?   无法返回变量。“java:找不到变量”   通过BigInteger进行Java基转换   在Java中获取日期格式   java构建具有依赖关系的jar并将其绑定到tar中。gz使用maven组装   java为什么Guice在main中从UncaughtExceptionHandler抛出$ComputeException?   spring升级到Java7时有哪些陷阱   java从JTable向数组获取值   java Android在启动新活动时会杀死多个以前的活动   postgresql是否可以在批处理过程中运行java命令?   安卓使用Java代码创建文件上传请求   java一些元素神奇地没有从ArrayList中删除