Documentation
¶
Index ¶
- func CreateOrOpenDb(name string) *sql.DB
- type SqliteApi
- func (sapi *SqliteApi) DeleteAllBy(cond string) error
- func (sapi *SqliteApi) DeleteById(id int) error
- func (sapi *SqliteApi) DropTable() error
- func (sapi *SqliteApi) Insert(cols string, values string) error
- func (sapi *SqliteApi) SelectAll() *sql.Rows
- func (sapi *SqliteApi) SelectById(id int) *sql.Row
- func (sapi *SqliteApi) Sync(cols string) error
- func (sapi *SqliteApi) UpdateById(id int, updates string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOrOpenDb ¶ added in v0.0.3
Types ¶
type SqliteApi ¶
SqliteApi structure is a structure that will interact with sqlite
func (*SqliteApi) DeleteAllBy ¶
it will delete all rows in db with specified condition
example: name="muka" AND id=1
func (*SqliteApi) DeleteById ¶ added in v0.0.2
func (*SqliteApi) Insert ¶
argument 'cols' is a string where you put all columns in which values will be inserted example: name, email argument 'values' is a string with values that will be inserted example: "muka", "cringer@asd.dq"
func (*SqliteApi) SelectAll ¶
if you need to get all rows just use it WARNING: it's returns *sql.Rows that means that other work you need to do on your own
func (*SqliteApi) SelectById ¶ added in v0.0.2
it will select item by id
Click to show internal directories.
Click to hide internal directories.