gomodel

command
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2017 License: MIT Imports: 16 Imported by: 0

README

gomodel

$ gomodel [OPTIONS] DIR|FILES...

Structure tags

  • table: table name
  • column: column name

Both using "-" to prevent from parsing.

Synax
type User struct {
    Id       string `table:"user" column:"user_id"`
    Name     string
    Password string
}
  • AST parsing: parsing sql AST
    Just use structure and field name replace table and column name. Example: replace
    SELECT user_id, name, password FROM user
    
    with
    SELECT Id, Name, Password FROM User
    
Position

sql should be put in function documents, and start with //gomodel

  • simple
//gomodel sqlname = SELECT Id, Name, Password FROM User
  • block
//gomodel sqlname = [
//  SELECT
//  Id, Name, Password
//  FROM
//  User
//]

The form of first and last line can't be changed.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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