简体   繁体   English

是否有喜欢的查询运算符,可以在“剧场扩展到peewee”中加入查询?

[英]Is there liking query operator ,join query In “playhouse extensions to peewee”?

I can use total CRUD by the MySQLDatabase that imported "from peewee import *" 我可以通过从“ peewee import *”导入的MySQLDatabase使用总CRUD

But when I see the "playhouse,extensions to peewee". 但是当我看到“剧场,延伸到小矮人”时。
I prefre this CRUD by the DataSet that improted "from playhouse.dataset import DataSet". 我认为这个CRUD是由扭曲了“从playhouse.dataset import DataSet”的DataSet组成的。
It seems likes the "pymongo" syntax, emmmmmm. 看起来像“ pymongo”语法,emmmmmm。 It is so convenient!! 真方便!!

But, I can't find the detail query in the document。 such as query operator, join query....... 但是,我在文档中找不到详细查询。例如查询运算符,联接查询.......

like the following example: 类似于以下示例:
prepare data in database: 准备数据库中的数据:

id name
1  Tom

I want to find the name contains 'om' in database. 我想在数据库中找到包含“ om”的名称。 by the "from peewee import *" way: 通过“从peewee导入*”的方式:

Owner.select().where(Owner.name.contains('om'))  

by the "from playhouse.dataset import DataSet" way: 通过“从playhouse.dataset导入DataSet”的方式:

owner = db['owner']
owner.find(??????????)     #  how to use contains  

finally I want to know that what scene I should use the DataSet's CRUD ??? 最后我想知道我应该在哪个场景下使用DataSet的CRUD?

The dataset API is designed for only the simplest kinds of usage. dataset API仅设计用于最简单的用法。 It is never intended to be a full replacement for the expressiveness of SQL. 它绝不打算完全替代SQL的表达。

dataset is designed to allow you to easily import/export/explore data, or work with it in a simple manner. 数据集旨在让您轻松导入/导出/浏览数据,或以简单的方式使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM