Documentation
¶
Overview ¶
Example ¶
package main
import (
"context"
"os"
"path/filepath"
"github.com/xoctopus/genx/pkg/genx"
"github.com/xoctopus/x/misc/must"
_ "github.com/xoctopus/sqlx/devpkg/sqlx/v1"
)
func main() {
root := filepath.Join(must.NoErrorV(os.Getwd()), "..", "..", "..")
ctx := genx.NewContext(&genx.Args{
Entrypoint: []string{
filepath.Join(root, "testdata"),
filepath.Join(root, "testdata", "v2"),
filepath.Join(root, "example", "models"),
},
})
if err := ctx.Execute(context.Background(), genx.Get()...); err != nil {
panic(err)
}
}
Index ¶
- func Span() func() time.Duration
- type Attr
- type Model
- func (m *Model) CommentOf(ref string) s.Snippet
- func (m *Model) CreationMarker() s.Snippet
- func (m *Model) DeletionMarker() s.Snippet
- func (m *Model) HasSoftDeletion() bool
- func (m *Model) Ident() s.Snippet
- func (m *Model) IndexList(unique bool) s.Snippet
- func (m *Model) ModeledCT(ctx context.Context, t typx.Type) s.Snippet
- func (m *Model) ModeledColDefList(ctx context.Context) s.Snippet
- func (m *Model) ModeledColInitList(ctx context.Context) s.Snippet
- func (m *Model) ModeledKeyDefList(ctx context.Context) s.Snippet
- func (m *Model) ModeledKeyInitList(_ context.Context) s.Snippet
- func (m *Model) ModeledM(ctx context.Context) s.Snippet
- func (m *Model) ModeledTCol(ctx context.Context, t typx.Type) s.Snippet
- func (m *Model) ModeledTable(ctx context.Context) s.Snippet
- func (m *Model) ModificationMarker() s.Snippet
- func (m *Model) PrimaryColList() s.Snippet
- func (m *Model) Register() s.Snippet
- func (m *Model) SoftDeletionCondition(ctx context.Context) s.Snippet
- func (m *Model) String() string
- func (m *Model) TableDesc() s.Snippet
- func (m *Model) TableName() s.Snippet
- func (m *Model) UniqueConditions(ctx context.Context, names []string) s.Snippet
- func (m *Model) UniqueFields(names []string) s.Snippet
- func (m *Model) UniqueNames() [][]string
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (*Model) CreationMarker ¶ added in v0.0.3
func (*Model) DeletionMarker ¶ added in v0.0.3
func (*Model) HasSoftDeletion ¶ added in v0.0.3
func (*Model) ModeledColInitList ¶
func (*Model) ModificationMarker ¶ added in v0.0.3
func (*Model) PrimaryColList ¶
func (*Model) SoftDeletionCondition ¶ added in v0.0.3
func (*Model) UniqueConditions ¶ added in v0.0.3
func (*Model) UniqueNames ¶ added in v0.0.3
Click to show internal directories.
Click to hide internal directories.