cre

package module
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 2 Imported by: 0

README

cre

cre 是一个代码生成框架,用于高效生成各种业务代码,主要使用场景是生成工程框架和CRUD类代码,大大缩短业务从设计到上线的时间。在框架层面保证高度的灵活和可扩展性,不限制业务场景。

特性

  • 解析数据库表结构,生成丰富的表述信息
  • 支持自定义模板,结合不同模板快速生成不同业务场景的项目
  • 支持 BelongsTo 、HasOne 、HasMany 、ManyToMany 关联配置
  • 支持配置校验信息
  • 支持业务的灵活扩展
  • 表结构更改可重复生成代码

文档

中文 | English

参与

鸣谢

本项目的产生离不开这些优秀项目的启发, 如有遗漏欢迎补充指正

https://github.com/LyricTian/gin-admin

https://github.com/cmelgarejo/go-gql-server

https://github.com/8treenet/freedom

https://github.com/jinzhu/gorm

https://github.com/wantedly/apig

https://github.com/facebook/ent

https://github.com/altas/altas

https://github.com/libragen/felix

https://github.com/smallnest/gen

https://github.com/webliupeng/gin-tonic

Documentation

Index

Constants

View Source
const (
	Fake     = "fake"
	MySQL    = "mysql"
	SQLite   = "sqlite3"
	Postgres = "postgres"
)

Dialect names.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver interface {
	ExecQuerier

	Close() error

	Dialect() string
}

type ExecQuerier

type ExecQuerier interface {
	Exec(ctx context.Context, query string, args ...any) (any, error)
	Query(ctx context.Context, query string, args ...any) (any, error)
	QueryRow(ctx context.Context, query string, args ...any) (any, error)
}

ExecQuerier wraps the database operations.

type Loader

type Loader interface {
	// Load loads the schema from the database.
	Load(ctx context.Context, name string) (*spec.Schema, error)
	Dialect() string
}

Directories

Path Synopsis
cmd
cre
gen
Package loader is the interface for loading an external resource into cre
Package loader is the interface for loading an external resource into cre
sql
test
sql

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL