帮助文档 https://www.zendata.cn/book/zendata/why-zendata-115.html
生成时间格式数据
数据定义
fields:
- field: date
from: time.date.v1.yaml
use: date
postfix: " "
- field: cn_date
from: time.date.v1.yaml
use: chinese
postfix: " "
- field: time
from: time.time.v1.yaml
use: time
postfix: " "
- field: time1 # 生成时间数据,以当前时间为准,从一月前到一周后。
range: "(-1M)-(+1w):60" # 支持当前时间的运算,Y、M、D、W、h、m、s分别对应年、月、日、周、时、分、秒。
type: timestamp
format: "YY/MM/DD hh🇲🇲ss"
postfix: "\\t"
- field: time2 # 生成时间数据,指定起止时间的方式,从早上9点到今天结束,间隔1分钟(60秒)。
range: "20210101 000000-20210101 230000:60" # 起始、结束时间用-分隔,默认为当天的开始和结束时间。
type: timestamp
format: "YY/MM/DD hh🇲🇲ss"
postfix: "\\t"
- field: time3 # 只设置一个时间时,默认当作起始时间,结束时间为当前日期的23时59分59秒
range: "20210821 000000:60" # 和20210821 000000-:60效果是一样的
type: timestamp
format: "YY/MM/DD hh🇲🇲ss"
postfix: "\\t"
- field: time4
range: "-20210830 235959:60" # 省略起始时间的用法
type: timestamp
format: "YY/MM/DD hh🇲🇲ss"
postfix: "\\t"
- field: time5 # 生成时间数据,以当前时间为准,从一月前到一周后。
range: "(-1M)-(+1w):60m" # 步长支持Y、M、D、W、h、m、s分别对应年、月、日、周、时、分、秒
type: timestamp
format: "YY/MM/DD hh🇲🇲ss"
postfix: "\\t"
- field: time6 # 生成时间数据,以当前时间为准,从一月前到一周后。
range: "(-1M)-(+1w):1D" # 步长支持Y、M、D、W、h、m、s分别对应年、月、日、周、时、分、秒
type: timestamp
format: "YY/MM/DD hh🇲🇲ss"
postfix: "\\t"
- field: time7 # 生成时间数据,以当前时间为准,从一月前到一周后。
range: "(+1w)-(-1M):-1D" # 步长为-1天
type: timestamp
format: "YY/MM/DD hh🇲🇲ss"
postfix: "\\t"
- field: time8 # 生成时间数据,以当前时间为准,从一月前到一周后。
range: "(+1w)-(-1M):1D" # 设置步长为1天,但是会自动的根据起止时间调整正负,实际为-1天
type: timestamp
format: "YY/MM/DD hh🇲🇲ss"
执行命令
zd -d demo/28_datetime.yaml
执行结果
生成UUID格式数据
数据定义
fields:
- field: field_uuid
format: "uuid(-)"
执行命令
zd -d demo/29_uuid.yaml
执行结果
新增MySQL字段属性的支持
执行命令
zd -i demo/field_test.sql -o demo/output
生成结果
title: table field_test
desc: ""
author: automated export
version: "1.0"
fields:
- field: Bit
range: 0,1
- field: TinyInt
range: 0-255
- field: SmallInt
range: 0-65535
- field: MediumInt
note: "MEDIUMINT [0,2^24-1]"
range: 0-65535
- field: GeometryCollection
range: "GEOMETRYCOLLECTION"
- field: Int
note: "INI [0,2^32-1]"
range: 0-100000
- field: BigInt
note: "BIGINT [0,2^64-1]"
range: 0-100000