в какой базе?
База sqlite, при конекшене создаю таблицу, заношу предварительные данные.
func createTablesIfNotExist(db *sql.DB) error {
sql := `
drop table if exists books;
create table if not exists books (
id integer primary key not null,
title varchar(255) not null,
author varchar(255) not null,
price integer not null
);
create unique index books_id_uindex on books (id);
delete from books;
insert into books (title, author, price) values("A cute love story", "Nidhi Agrawal", 1.32);
insert into books (title, author, price) values("Ultimate Pleasure", "Rachel G", 1.54);
insert into books (title, author, price) values("A Howl In The Night", "Lorelei Sutton", 2.02);
`
if _, err := db.Exec(sql); err != nil {
return err
}
return nil
}