Giter Site home page Giter Site logo

zendata's People

Contributors

aaronchen2k avatar berstpander avatar catouse avatar ccebot avatar dependabot[bot] avatar fantasyleo avatar hind3ight avatar ysicing avatar yuaiwuhen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zendata's Issues

sql 转换成yaml 问题(待回复)

Create sql 里面如果有索引。 则转换出来的 yaml 模板 ,会将index 作为 字段 生成到 yaml 里面
如果创建的table a sql 命令'a' 和() 中间有多个空格,那么创建的yaml 文件为 a .yaml ,正常应该是 a.yaml

range 不支持浮点数

数据格式配置文件

title: test_random_float
fields:
  - field: float
    range: 1.0001-1.9999
    postfix: "\t"
  - field: float_r
    range: 1.0001-1.9999:R

生成的数据

1.0	1.0
1.0	1.0
1.0	1.0
1.0	1.0
1.0	1.0
1.0	1.0
1.0	1.0
1.0	1.0
1.0	1.0
1.0	1.0

不能成功编译

错误信息

start compile linux
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC=/usr/local/gcc-4.8.1-for-linux64/bin/x86_64-pc-linux-gcc CXX=/usr/local/gcc-4.8.1-for-linux64/bin/x86_64-pc-linux-g++ go build -o bin/zd/2.1/linux/zd/zd src/zd.go
src/zd.go:6:2: no required module provides package github.com/easysoft/zendata/res; to add it:
go get github.com/easysoft/zendata/res
make: *** [Makefile:45: compile_linux] Error 1

zd.go

import (
"flag"
"fmt"
"github.com/easysoft/zendata/res"
"github.com/easysoft/zendata/src/action"
"github.com/easysoft/zendata/src/gen"
"github.com/easysoft/zendata/src/server"
serverConfig "github.com/easysoft/zendata/src/server/config"
serverUtils "github.com/easysoft/zendata/src/server/utils"
serverConst "github.com/easysoft/zendata/src/server/utils/const"
"github.com/easysoft/zendata/src/service"
commonUtils "github.com/easysoft/zendata/src/utils/common"
configUtils "github.com/easysoft/zendata/src/utils/config"
constant "github.com/easysoft/zendata/src/utils/const"
fileUtils "github.com/easysoft/zendata/src/utils/file"
i118Utils "github.com/easysoft/zendata/src/utils/i118"
logUtils "github.com/easysoft/zendata/src/utils/log"
stringUtils "github.com/easysoft/zendata/src/utils/string"
"github.com/easysoft/zendata/src/utils/vari"
assetfs "github.com/elazarl/go-bindata-assetfs"
"github.com/fatih/color"
"io/ioutil"
"net/http"
"os"
"os/signal"
"path/filepath"
"strconv"
"strings"
"syscall"
"time"
)

.gitignore

/log/
/.idea/
/build/
/tmp/cache/.data.db-shm
/tmp/cache/.data.db-wal
/demo/out/
/conf/
/bin/
/test/ztf/output/
/test/ztf/.idea/
/nohup.out
/test/ztf/conf/
/test/ztf/log/
/demo/out/
/test/ztf/._config.yaml
/test/ztf/._default.yaml
/._config.yaml
/._default.yaml
/res/res.go
/tmp/.temp.yaml
/tmp/.default.yaml
/tmp/.config.yaml
/qshell.log
/log-zd/
/data/test/
/test/out/
/yaml/article/chinese/slang/out/
/runtime/protobuf/go
/runtime/protobuf/out/
/users/common/

Default配置覆盖问题

Default配置覆盖,覆盖文件前后缀定义为空的时候,还是会引用被覆盖文件的前后缀。

例如:覆盖文件前缀定义为:prefix: "",被覆盖文件前缀定义为:prefix: "asd",生成数据时前缀是asd。

outdated documents that cannot be called

version: 2.2

zd.exe -p 8848
客户端调用:

$curl http://localhost:8848/?d=demo/default.yaml&c=demo/config.yaml&n=100&T=true    # 通过GET方式指定服务器端配置文件。
$curl http://localhost:8848/?default=demo/default.yaml&output=test.sql&table=user   # 参数名可以用全拼。
$curl -i -X POST http://localhost:8848?lines=3 -F default=@demo/default.yaml        # 可以通过POST方式上传配置文件。

It doesn't work.

从实例中获取数据生成的时候,当数量超过某个数值就会报错。

实例文件

title: user                                                                                                                    
desc: 创建一些默认用户
author: ly
version: 1.0 

instances:
  - instance: user
    note: 默认用户列表
    fields:
     - field: user
       range: admin,dev1,dev2,dev3,test1,test2,test3
  - instance: userB
    note: 逗号拼接用户
    fields:
     - field: user1
       range: admin
       postfix: "," 
     - field: user2
       range: dev1
       postfix: "," 
     - field: user3
       range: dev2

生成数据文件:

title: table zt_story
desc: "需求"
author: automated export
version: "1.0"
fields:
  - field: id
    note: "ID"
    range: 1-10000
    prefix: ""
    postfix: ""
    loop: 0
    format: ""
  - field: date
    note: "日期"
    from: common.user.v1.yaml
    use: userB                                                                                                                 
    prefix: ""
    postfix: ""
    loop: 0
    format: ""

调用命令:

❯ zd -c aaaaa.yaml -n 100 -o out.sql -table aaa
❯ zd -c aaaaa.yaml -n 1000 -o out.sql -table aaa
❯ zd -c aaaaa.yaml -n 10000 -o out.sql -table aaa
❯ zd -c aaaaa.yaml -n 10001 -o out.sql -table aaa
为Field 生成数据失败。
为Field 生成数据失败。

超过10001条数据的时候,报错了

这个到底是什么啊

/Users/aaron/rd/project/zentao/go/zd/internal/pkg/service/excel.go:415 no such table: excel_update
[0.000ms] [rows:-] SELECT id, name, changeTime FROM excel_update WHERE name = 'D:\Programming\OpenSourceTools\zd\data\city\v1.xlsx' ORDER BY changeTime DESC LIMIT 1;
SQLite查询失败,语句:SELECT id, name, changeTime FROM excel_update WHERE name = 'D:\Programming\OpenSourceTools\zd\data\city\v1.xlsx' ORDER BY changeTime DESC LIMIT 1;,错误:no such table: excel_update。

中文姓名生成效率太低

测试了一下生成10条数据花了60秒,是我的写法有问题吗?这效率已经超出我的想象范围了。
yaml文件如下:

title: 用户数据生成
fields:
  - field: name
    from: name.cn.given.v1
    where: "double='true'"
    select: name

看了一下人名的excel里有几万条数据。

web interface calls to generate data in other formats

web接口调用

Is it possible to support data generation by configuring the format in yaml and then generate it directly through web interface calls?

It is possible to output data in other formats at the command line, but I have to maintain my command line scripts. Why not integrate it into a web page to manage it?

定义数据文件类型

目前只能支持yaml格式文件吗?能否支持proto文件,基于proto定义的rpc服务生成对应的response数据?

Please add more online features, such as Online generation of multi-format data types

Zendata tool localization tool is very good, currently intended to be used for platforming.

But zendata http protocol only supports the generation of json data, localization of csv, sql, xml format can not be generated.

Super useful mysql data direct generation function can not be used in http.

Currently the zendata command line tool is exposed as an http interface
through shell2http tool.

I hope that the subsequent support for http interface multi-format data generation.

不支持sqlserver?

经测试对sqlserver的数据库连接,以及-i导入,无法正常使用

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.