Documentation ¶
Overview ¶
Package db contains generated code for schema 'production.sqlite3'.
Package db contains the types for schema ”.
Index ¶
- Variables
- func AllIDs(ctx context.Context, db DB) ([]int, error)
- func Errorf(s string, v ...interface{})
- func Logf(s string, v ...interface{})
- func SetErrorLogger(logger interface{})
- func SetLogger(logger interface{})
- type DB
- type ErrInsertFailed
- type ErrInvalidTime
- type ErrUpdateFailed
- type ErrUpsertFailed
- type Error
- type OauthToken
- func OauthTokenByAppClientIDClientSecretOriginalRefreshToken(ctx context.Context, db DB, ...) (*OauthToken, error)
- func OauthTokenByAppClientIDClientSecretRefreshToken(ctx context.Context, db DB, app, clientID, clientSecret, refreshToken string) (*OauthToken, error)
- func OauthTokenByAppRefreshToken(ctx context.Context, db DB, app, refreshToken string) (*OauthToken, error)
- func OauthTokenByID(ctx context.Context, db DB, id int) (*OauthToken, error)
- func OauthTokensByAppAccessToken(ctx context.Context, db DB, app, accessToken string) ([]*OauthToken, error)
- func OauthTokensByAppOriginalRefreshToken(ctx context.Context, db DB, app, originalRefreshToken string) ([]*OauthToken, error)
- func (ot *OauthToken) Delete(ctx context.Context, db DB) error
- func (ot *OauthToken) Deleted() bool
- func (ot *OauthToken) Exists() bool
- func (ot *OauthToken) Insert(ctx context.Context, db DB) error
- func (ot *OauthToken) Save(ctx context.Context, db DB) error
- func (ot *OauthToken) Update(ctx context.Context, db DB) error
- func (ot *OauthToken) Upsert(ctx context.Context, db DB) error
- type ScannerValuer
- type Slice
- type StringSlice
- type Time
- func (t Time) Format(layout string) string
- func (t Time) MarshalJSON() ([]byte, error)
- func (t *Time) Parse(s string) error
- func (t *Time) Scan(v interface{}) error
- func (t Time) String() string
- func (t Time) Time() time.Time
- func (t *Time) UnmarshalJSON(data []byte) error
- func (t Time) Value() (driver.Value, error)
- type TokenRequest
- func (tr *TokenRequest) Delete(ctx context.Context, db DB) error
- func (tr *TokenRequest) Deleted() bool
- func (tr *TokenRequest) Exists() bool
- func (tr *TokenRequest) Insert(ctx context.Context, db DB) error
- func (tr *TokenRequest) Save(ctx context.Context, db DB) error
- func (tr *TokenRequest) Update(ctx context.Context, db DB) error
- func (tr *TokenRequest) Upsert(ctx context.Context, db DB) error
- type XODB
Constants ¶
This section is empty.
Variables ¶
var TimestampFormats = []string{
"2006-01-02 15:04:05.999999999-07:00",
"2006-01-02T15:04:05.999999999-07:00",
"2006-01-02 15:04:05.999999999",
"2006-01-02T15:04:05.999999999",
"2006-01-02 15:04:05",
"2006-01-02T15:04:05",
"2006-01-02 15:04",
"2006-01-02T15:04",
"2006-01-02",
}
TimestampFormats are the timestamp formats used by SQLite3 database drivers to store a time.Time in SQLite3.
The first format in the slice will be used when saving time values into the database. When parsing a string from a timestamp or datetime column, the formats are tried in order.
var XOLog = func(string, ...interface{}) {}
XOLog provides the log func used by generated queries.
Functions ¶
func Errorf ¶
func Errorf(s string, v ...interface{})
Errorf logs an error message using the package error logger.
func SetErrorLogger ¶
func SetErrorLogger(logger interface{})
SetErrorLogger sets the package error logger. Valid logger types:
io.Writer func(string, ...interface{}) (int, error) // fmt.Printf func(string, ...interface{}) // log.Printf
Types ¶
type DB ¶
type DB interface { ExecContext(context.Context, string, ...interface{}) (sql.Result, error) QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error) QueryRowContext(context.Context, string, ...interface{}) *sql.Row }
DB is the common interface for database operations that can be used with types from schema 'production.sqlite3'.
This works with both database/sql.DB and database/sql.Tx.
type ErrInsertFailed ¶
type ErrInsertFailed struct {
Err error
}
ErrInsertFailed is the insert failed error.
func (*ErrInsertFailed) Error ¶
func (err *ErrInsertFailed) Error() string
Error satisfies the error interface.
func (*ErrInsertFailed) Unwrap ¶
func (err *ErrInsertFailed) Unwrap() error
Unwrap satisfies the unwrap interface.
type ErrInvalidTime ¶
type ErrInvalidTime string
ErrInvalidTime is the invalid Time error.
func (ErrInvalidTime) Error ¶
func (err ErrInvalidTime) Error() string
Error satisfies the error interface.
type ErrUpdateFailed ¶
type ErrUpdateFailed struct {
Err error
}
ErrUpdateFailed is the update failed error.
func (*ErrUpdateFailed) Error ¶
func (err *ErrUpdateFailed) Error() string
Error satisfies the error interface.
func (*ErrUpdateFailed) Unwrap ¶
func (err *ErrUpdateFailed) Unwrap() error
Unwrap satisfies the unwrap interface.
type ErrUpsertFailed ¶
type ErrUpsertFailed struct {
Err error
}
ErrUpsertFailed is the upsert failed error.
func (*ErrUpsertFailed) Error ¶
func (err *ErrUpsertFailed) Error() string
Error satisfies the error interface.
func (*ErrUpsertFailed) Unwrap ¶
func (err *ErrUpsertFailed) Unwrap() error
Unwrap satisfies the unwrap interface.
type Error ¶
type Error string
Error is an error.
const ( // ErrAlreadyExists is the already exists error. ErrAlreadyExists Error = "already exists" // ErrDoesNotExist is the does not exist error. ErrDoesNotExist Error = "does not exist" // ErrMarkedForDeletion is the marked for deletion error. ErrMarkedForDeletion Error = "marked for deletion" )
Error values.
type OauthToken ¶
type OauthToken struct { ID int `json:"id"` // id App string `json:"app"` // app Type string `json:"type"` // type ClientID string `json:"client_id"` // client_id ClientSecret string `json:"client_secret"` // client_secret OriginalRefreshToken string `json:"original_refresh_token"` // original_refresh_token RefreshToken string `json:"refresh_token"` // refresh_token AccessToken string `json:"access_token"` // access_token ExpiresAt *Time `json:"expires_at"` // expires_at CreatedAt Time `json:"created_at"` // created_at UpdatedAt Time `json:"updated_at"` // updated_at CodeExchangeResponseBody sql.NullString `json:"code_exchange_response_body"` // code_exchange_response_body CodeVerifier string `json:"code_verifier"` // code_verifier RefreshTokenExpiresAt *Time `json:"refresh_token_expires_at"` // refresh_token_expires_at // contains filtered or unexported fields }
OauthToken represents a row from 'oauth_tokens'.
func OauthTokenByAppClientIDClientSecretOriginalRefreshToken ¶
func OauthTokenByAppClientIDClientSecretOriginalRefreshToken(ctx context.Context, db DB, app, clientID, clientSecret, originalRefreshToken string) (*OauthToken, error)
OauthTokenByAppClientIDClientSecretOriginalRefreshToken retrieves a row from 'oauth_tokens' as a OauthToken.
Generated from index 'ot_app_client_id_client_secret_original_refresh_token'.
func OauthTokenByAppClientIDClientSecretRefreshToken ¶
func OauthTokenByAppClientIDClientSecretRefreshToken(ctx context.Context, db DB, app, clientID, clientSecret, refreshToken string) (*OauthToken, error)
OauthTokenByAppClientIDClientSecretRefreshToken retrieves a row from 'oauth_tokens' as a OauthToken.
Generated from index 'ot_app_client_id_client_secret_refresh_token'.
func OauthTokenByAppRefreshToken ¶
func OauthTokenByAppRefreshToken(ctx context.Context, db DB, app, refreshToken string) (*OauthToken, error)
OauthTokenByAppRefreshToken retrieves a row from 'oauth_tokens' as a OauthToken.
Generated from index 'ot_app_refresh_token'.
func OauthTokenByID ¶
OauthTokenByID retrieves a row from 'oauth_tokens' as a OauthToken.
Generated from index 'oauth_tokens_id_pkey'.
func OauthTokensByAppAccessToken ¶
func OauthTokensByAppAccessToken(ctx context.Context, db DB, app, accessToken string) ([]*OauthToken, error)
OauthTokensByAppAccessToken retrieves a row from 'oauth_tokens' as a OauthToken.
Generated from index 'ot_app_access_token'.
func OauthTokensByAppOriginalRefreshToken ¶
func OauthTokensByAppOriginalRefreshToken(ctx context.Context, db DB, app, originalRefreshToken string) ([]*OauthToken, error)
OauthTokensByAppOriginalRefreshToken retrieves a row from 'oauth_tokens' as a OauthToken.
Generated from index 'ot_app_original_refresh_token'.
func (*OauthToken) Delete ¶
func (ot *OauthToken) Delete(ctx context.Context, db DB) error
Delete deletes the OauthToken from the database.
func (*OauthToken) Deleted ¶
func (ot *OauthToken) Deleted() bool
Deleted returns true when the OauthToken has been marked for deletion from the database.
func (*OauthToken) Exists ¶
func (ot *OauthToken) Exists() bool
Exists returns true when the OauthToken exists in the database.
func (*OauthToken) Insert ¶
func (ot *OauthToken) Insert(ctx context.Context, db DB) error
Insert inserts the OauthToken to the database.
func (*OauthToken) Save ¶
func (ot *OauthToken) Save(ctx context.Context, db DB) error
Save saves the OauthToken to the database.
func (*OauthToken) Update ¶
func (ot *OauthToken) Update(ctx context.Context, db DB) error
Update updates a OauthToken in the database.
func (*OauthToken) Upsert ¶
func (ot *OauthToken) Upsert(ctx context.Context, db DB) error
Upsert performs an upsert for OauthToken.
type ScannerValuer ¶
ScannerValuer is the common interface for types that implement both the database/sql.Scanner and sql/driver.Valuer interfaces.
type StringSlice ¶
type StringSlice []string
StringSlice is a slice of strings.
func (*StringSlice) Scan ¶
func (ss *StringSlice) Scan(src interface{}) error
Scan satisfies the sql.Scanner interface for StringSlice.
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
Time is a SQLite3 Time that scans for the various timestamps values used by SQLite3 database drivers to store time.Time values.
func (Time) MarshalJSON ¶
MarshalJSON satisfies the [json.Marshaler] interface.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON satisfies the [json.Unmarshaler] interface.
type TokenRequest ¶
type TokenRequest struct { ID int `json:"id"` // id App string `json:"app"` // app RequestClientID string `json:"request_client_id"` // request_client_id RequestClientSecret string `json:"request_client_secret"` // request_client_secret RequestRefreshToken string `json:"request_refresh_token"` // request_refresh_token RequestCode string `json:"request_code"` // request_code RequestRedirectURL string `json:"request_redirect_url"` // request_redirect_url RequestCodeVerifier string `json:"request_code_verifier"` // request_code_verifier ResponseAccessToken string `json:"response_access_token"` // response_access_token ResponseTokenType string `json:"response_token_type"` // response_token_type ResponseRefreshToken string `json:"response_refresh_token"` // response_refresh_token ResponseExpiry Time `json:"response_expiry"` // response_expiry ResponseExtra string `json:"response_extra"` // response_extra CreatedAt Time `json:"created_at"` // created_at UpdatedAt Time `json:"updated_at"` // updated_at // contains filtered or unexported fields }
TokenRequest represents a row from 'token_requests'.
func TokenRequestByID ¶
TokenRequestByID retrieves a row from 'token_requests' as a TokenRequest.
Generated from index 'token_requests_id_pkey'.
func (*TokenRequest) Delete ¶
func (tr *TokenRequest) Delete(ctx context.Context, db DB) error
Delete deletes the TokenRequest from the database.
func (*TokenRequest) Deleted ¶
func (tr *TokenRequest) Deleted() bool
Deleted returns true when the TokenRequest has been marked for deletion from the database.
func (*TokenRequest) Exists ¶
func (tr *TokenRequest) Exists() bool
Exists returns true when the TokenRequest exists in the database.
func (*TokenRequest) Insert ¶
func (tr *TokenRequest) Insert(ctx context.Context, db DB) error
Insert inserts the TokenRequest to the database.
func (*TokenRequest) Save ¶
func (tr *TokenRequest) Save(ctx context.Context, db DB) error
Save saves the TokenRequest to the database.
func (*TokenRequest) Update ¶
func (tr *TokenRequest) Update(ctx context.Context, db DB) error
Update updates a TokenRequest in the database.
func (*TokenRequest) Upsert ¶
func (tr *TokenRequest) Upsert(ctx context.Context, db DB) error
Upsert performs an upsert for TokenRequest.
type XODB ¶
type XODB interface { Exec(string, ...interface{}) (sql.Result, error) Query(string, ...interface{}) (*sql.Rows, error) QueryRow(string, ...interface{}) *sql.Row }
XODB is the common interface for database operations that can be used with types from schema ”.
This should work with database/sql.DB and database/sql.Tx.