Documentation
¶
Index ¶
- Constants
- Variables
- func CreateMetaTable(dbCon *sql.DB) error
- func DownMigrate(dbCon *sql.DB, migrationFile string) error
- func GetLatestId(dbCon *sql.DB) (int, error)
- func MigrationFile(dbConn *sql.DB, fileName, createMigDirName, MigFilename string) (newJSON, changeJSON string, err error)
- func SqLiteCreateTable(schema Schema) (upQuery, downQuery string)
- func SqliteConn(dbFileName string) (*sql.DB, error)
- func SqliteMigration(changes ChangeLog) (upQuery, downQuery string)
- func UpMigrate(dbCon *sql.DB, migrationFile, newJSON, changeJSON string) error
- type ChangeLog
- type Create
- type Delete
- type GobaseMetadata
- type Schema
- type SchemaField
- type Update
Constants ¶
View Source
const ( // Update Types NAMEUPDATE = "Name" DATATYPEUPDATE = "DataType" // Update Action On ONTABLE = "Table" ONFIELD = "Field" // Creation Types FIELD = "Field" )
View Source
const DBFILENAME = "db.sqlite3"
View Source
const (
SQLITE = "sqlite3"
)
Variables ¶
View Source
var ErrNoChange = errors.New("No changes detected")
Functions ¶
func CreateMetaTable ¶
func MigrationFile ¶
func SqLiteCreateTable ¶
func SqliteMigration ¶
Types ¶
type GobaseMetadata ¶
type GobaseMetadata struct {
ID int `gobase:"primary_key"`
CurrentState string `gobase:""`
Changes_made string `gobase:""`
CreatedAt time.Time `gobase:"default:current_timestamp"`
}
This is to be used to create the query when the tags usable is added, currently not supported.
type Schema ¶
type Schema struct {
SchemaName string `json:"schema_name"`
SchemaFields []SchemaField `json:"schema_fields"`
}
type SchemaField ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.