Skip to content

Commit

Permalink
add MIT LICENSE & README
Browse files Browse the repository at this point in the history
  • Loading branch information
liujianping committed Aug 29, 2021
1 parent e9be724 commit 54a4862
Show file tree
Hide file tree
Showing 2 changed files with 136 additions and 1 deletion.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016 JayL [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
116 changes: 115 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,123 @@
# orm

## Quick Start
## 快速开始

- YAML 定义数据结构

```yaml
version: v1
object: table
name: user
comment: ""
attributes:
table: user
engine: innodb
charset: utf8mb4
tags:
- json
- yaml
fields:
- name: id
type: int32
comment: name of Hello
attributes:
autoIncrement: true
- name: name
type: string
comment: name of Hello
attributes:
primary: true
index: true
- name: Age
type: int32
comment: age of Hello
attributes:
nullable: true
- name: Sex
type: bool
attributes:
dbtype: TINYINT
- name: FooBar
type: int32
comment: fooBar
tags:
json: foo
yaml: bar
attributes:
nullable: true
- name: CreateAt
type: datetime
comment: create_at
- name: UpdateAt
type: datetime
comment: update_at
attributes:
nullable: true
uniques:
- fields:
- name
indexes:
- fields:
- age
- sex
primary:
- id
---
version: v1
object: query
name: summary
tags:
- json
- yaml
fields:
- name: id
type: int32
comment: name of Hello
attributes:
autoIncrement: true
- name: name
type: string
comment: name of Hello
attributes:
primary: true
index: true
- name: Age
type: int32
comment: age of Hello
attributes:
nullable: true
- name: Sex
type: bool
attributes:
dbtype: TINYINT
```
- 命令生成代码与脚本
```sh
$: orm -h
Usage:
orm [command]

Available Commands:
code code command
decode orm decode string
encode orm encode string
help Help about any command
password orm password string
script script command

Flags:
-p, --go-package-name string go package name (default "model")
-h, --help help for orm
-i, --input string input directory (default ".")
-o, --output string output directory (default ".")
-t, --template-suffix string template suffix (default ".gogo")
--version version for orm

Use "orm [command] --help" for more information about a command.
```

## 修改模板

TODO

0 comments on commit 54a4862

Please sign in to comment.