metaproj

command module
v0.0.0-...-dd40947 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: MIT Imports: 11 Imported by: 0

README

metaproj (v4.0)

Automatically create a metaapi project, requires metaapi

New for v4:

  • Support BYTEA

New for v3:

  • Project setup for a fully functioning web server with Vue/Vuetify (-type=vue)

v3.0 matches Medium article:

  • Automatic Applications in Go (in progress)

Previous versions:

Pull the v2.0 tag metaproj commit to have code that matches the Medium article:

See also:

Most Common Scenario:

#assume project and database name: todo (can be anything)
#assume sql file: events.sql (from examples, but can be anything)
createuser -P -d todo <pass: todo>
createdb todo
go get github.com/exyzzy/metaapi
go install $GOPATH/src/github.com/exyzzy/metaapi
go get github.com/exyzzy/metaproj
go install $GOPATH/src/github.com/exyzzy/metaproj
cp $GOPATH/src/github.com/exyzzy/metaapi/examples/events.sql .
metaproj -sql=events.sql -proj=todo -type=vue
cd todo
go generate
go install
go test

Legacy:

First create your PostgreSQL project database:

createuser -P -d myproj <pass: myproj>
createdb myproj

Create a default internal metaapi project:

go get github.com/exyzzy/metaapi
go install $GOPATH/src/github.com/exyzzy/metaapi
go get github.com/exyzzy/metaproj
go install $GOPATH/src/github.com/exyzzy/metaproj
cp $GOPATH/src/github.com/exyzzy/metaapi/examples/alltypes.sql .
# or your own postgreSQL table definition
rm -rf myproj
#clean out the old directory if needed
metaproj -sql=alltypes.sql -proj=myproj 
cd myproj
go generate
go test

Create an external metaapi project, where you want to develop custom templates:

go get github.com/exyzzy/metaapi
go install $GOPATH/src/github.com/exyzzy/metaapi
go get github.com/exyzzy/metaproj
go install $GOPATH/src/github.com/exyzzy/metaproj
go get github.com/exyzzy/pipe
go install $GOPATH/src/github.com/exyzzy/pipe
cp $GOPATH/src/github.com/exyzzy/metaapi/examples/alltypes.sql .
metaproj -sql=alltypes.sql -proj=myproj -type=external 
# or your own postgreSQL table definition
rm -rf myproj
#clean out the old directory if needed
cd myproj
go install
go generate
go test

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package main Code generated by go-bindata.
Package main Code generated by go-bindata.

Jump to

Keyboard shortcuts

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