mirror of https://github.com/agola-io/agola
42 lines
723 B
Go
42 lines
723 B
Go
|
|
// Code generated by go generate; DO NOT EDIT.
|
|
package db
|
|
|
|
import (
|
|
stdsql "database/sql"
|
|
|
|
"agola.io/agola/internal/sqlg"
|
|
"agola.io/agola/internal/sqlg/sql"
|
|
|
|
"github.com/sorintlab/errors"
|
|
)
|
|
|
|
func (d *DB) Version() uint { return 1 }
|
|
|
|
func (d *DB) DDL() []string {
|
|
switch d.DBType() {
|
|
case sql.Postgres:
|
|
return DDLPostgres
|
|
case sql.Sqlite3:
|
|
return DDLSqlite3
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (d *DB) Sequences() []sqlg.Sequence {
|
|
return Sequences
|
|
}
|
|
|
|
func (d *DB) scanArray(rows *stdsql.Rows, colsList ...[]any) error {
|
|
fields := []any{}
|
|
for _, cols := range colsList {
|
|
fields = append(fields, cols...)
|
|
}
|
|
if err := rows.Scan(fields...); err != nil {
|
|
return errors.Wrap(err, "failed to scan row")
|
|
}
|
|
|
|
return nil
|
|
}
|