Skip to content

titogeorge/sqliteutils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sqliteutils

SQLite statement generator

Go Report Card

Build Status

codecov

type ATable struct {
	ID     int64
	Type   string
	AValue string
}

func (a *ATable) GetTableName() string {
	return "ATable"
}

func (a *ATable) GetIDFields() []string {
	return []string{"ID", "Type"}
}

func (a *ATable) AutoIncrementPK() bool {
	return false
}

sqliteutils.GenerateCreateStmt(&ATable{})
// CREATE TABLE IF NOT EXISTS MuitiPK( ID integer, Type TEXT, AValue TEXT, PRIMARY KEY(ID, Type)); 

sqliteutils.GenerateInsertStmt(&ATable{ID: 10, Type: "Test", AValue: "ATest"})
//INSERT INTO MuitiPK(ID, Type, AValue) VALUES (10, 'Test', 'ATest');

About

SQLite statement generator

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages