Python百日进阶-Web开发-PeeweeDay280 - SQLite 扩展(五)
发布时间
阅读量:
阅读量
文章目录
-
-
- 12.2.11 class TableFunction
- 12.2.12 ClosureTable
- 12.2.13 class BaseClosureTable
-
12.2.11 class TableFunction
class TableFunction
开发自定义表格值函数。与仅返回单一标量数据的常规标量或聚合函数不同,自定义表格值函数能够生成任意数量的数据行。
简单的例子:
from playhouse.sqlite_ext import TableFunction
class Series(TableFunction):
# Name of columns in each row of generated data.
columns = ['value']
# Name of parameters the function may be called with.
params = ['start', 'stop', 'step']
def initialize(self, start=0, stop=None, step=1):
"""
全部评论 (0)
还没有任何评论哟~
