Files
amcs/internal/generatedmodels/sql_public_oauth_clients.go
T
Hein 3d4e6d0939
CI / build-and-test (push) Successful in 1m54s
Release / release (push) Successful in 3m12s
feat(sqltypes): add nullable SQL types with automatic casting
* Introduced SqlNull type for nullable values with auto-casting.
* Implemented JSON, YAML, and XML marshaling/unmarshaling.
* Added specific types for common SQL types (e.g., SqlInt64, SqlString).
* Included utility functions for creating nullable types.
* Added SqlTimeStamp, SqlDate, and SqlTime types with custom formatting.
2026-07-15 12:55:15 +02:00

63 lines
2.0 KiB
Go

// Code generated by relspecgo. DO NOT EDIT.
package generatedmodels
import (
"fmt"
sql_types "git.warky.dev/wdevs/relspecgo/pkg/sqltypes"
"github.com/uptrace/bun"
)
type ModelPublicOauthClients struct {
bun.BaseModel `bun:"table:public.oauth_clients,alias:oauth_clients"`
ID sql_types.SqlInt64 `bun:"id,type:bigserial,pk,autoincrement," json:"id"`
ClientID sql_types.SqlString `bun:"client_id,type:text,notnull," json:"client_id"`
ClientName sql_types.SqlString `bun:"client_name,type:text,default:'',notnull," json:"client_name"`
CreatedAt sql_types.SqlTimeStamp `bun:"created_at,type:timestamptz,default:now(),notnull," json:"created_at"`
RedirectUris sql_types.SqlStringArray `bun:"redirect_uris,type:text[],default:'{}',notnull," json:"redirect_uris"`
}
// TableName returns the table name for ModelPublicOauthClients
func (m ModelPublicOauthClients) TableName() string {
return "public.oauth_clients"
}
// TableNameOnly returns the table name without schema for ModelPublicOauthClients
func (m ModelPublicOauthClients) TableNameOnly() string {
return "oauth_clients"
}
// SchemaName returns the schema name for ModelPublicOauthClients
func (m ModelPublicOauthClients) SchemaName() string {
return "public"
}
// GetID returns the primary key value
func (m ModelPublicOauthClients) GetID() int64 {
return m.ID.Int64()
}
// GetIDStr returns the primary key as a string
func (m ModelPublicOauthClients) GetIDStr() string {
return m.ID.String()
}
// SetID sets the primary key value
func (m ModelPublicOauthClients) SetID(newid int64) {
m.UpdateID(newid)
}
// UpdateID updates the primary key value
func (m *ModelPublicOauthClients) UpdateID(newid int64) {
m.ID.FromString(fmt.Sprintf("%d", newid))
}
// GetIDName returns the name of the primary key column
func (m ModelPublicOauthClients) GetIDName() string {
return "id"
}
// GetPrefix returns the table prefix
func (m ModelPublicOauthClients) GetPrefix() string {
return "OCA"
}