work on optimising vcenter queries
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -876,6 +876,32 @@ func (q *Queries) ListUnprocessedEvents(ctx context.Context, eventtime sql.NullI
|
||||
return items, nil
|
||||
}
|
||||
|
||||
const sqliteColumnExists = `-- name: SqliteColumnExists :one
|
||||
SELECT COUNT(1) AS count
|
||||
FROM pragma_table_info
|
||||
WHERE name = ?1
|
||||
`
|
||||
|
||||
func (q *Queries) SqliteColumnExists(ctx context.Context, columnName sql.NullString) (int64, error) {
|
||||
row := q.db.QueryRowContext(ctx, sqliteColumnExists, columnName)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
return count, err
|
||||
}
|
||||
|
||||
const sqliteTableExists = `-- name: SqliteTableExists :one
|
||||
SELECT COUNT(1) AS count
|
||||
FROM sqlite_master
|
||||
WHERE type = 'table' AND name = ?1
|
||||
`
|
||||
|
||||
func (q *Queries) SqliteTableExists(ctx context.Context, tableName sql.NullString) (int64, error) {
|
||||
row := q.db.QueryRowContext(ctx, sqliteTableExists, tableName)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
return count, err
|
||||
}
|
||||
|
||||
const updateEventsProcessed = `-- name: UpdateEventsProcessed :exec
|
||||
UPDATE events
|
||||
SET "Processed" = 1
|
||||
|
||||
Reference in New Issue
Block a user