date type
This commit is contained in:
parent
6928e2432c
commit
2c298bef33
3 changed files with 36 additions and 32 deletions
|
@ -7,9 +7,9 @@ package database
|
|||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
|
||||
const addCall = `-- name: AddCall :one
|
||||
|
@ -36,7 +36,7 @@ type AddCallParams struct {
|
|||
Submitter *int32 `json:"submitter"`
|
||||
System int `json:"system"`
|
||||
Talkgroup int `json:"talkgroup"`
|
||||
CallDate pgtype.Timestamp `json:"call_date"`
|
||||
CallDate time.Time `json:"call_date"`
|
||||
AudioName *string `json:"audio_name"`
|
||||
AudioBlob []byte `json:"audio_blob"`
|
||||
AudioType *string `json:"audio_type"`
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
package database
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
|
@ -12,7 +14,7 @@ import (
|
|||
type ApiKey struct {
|
||||
ID int32 `json:"id"`
|
||||
Owner *int32 `json:"owner"`
|
||||
CreatedAt pgtype.Timestamp `json:"created_at"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
Expires pgtype.Timestamp `json:"expires"`
|
||||
Disabled *bool `json:"disabled"`
|
||||
ApiKey uuid.UUID `json:"api_key"`
|
||||
|
@ -23,7 +25,7 @@ type Call struct {
|
|||
Submitter *int32 `json:"submitter"`
|
||||
System int `json:"system"`
|
||||
Talkgroup int `json:"talkgroup"`
|
||||
CallDate pgtype.Timestamp `json:"call_date"`
|
||||
CallDate time.Time `json:"call_date"`
|
||||
AudioName *string `json:"audio_name"`
|
||||
AudioBlob []byte `json:"audio_blob"`
|
||||
AudioType *string `json:"audio_type"`
|
||||
|
|
|
@ -20,5 +20,7 @@ sql:
|
|||
go_type: "int"
|
||||
- db_type: "pg_catalog.serial4"
|
||||
go_type: "int"
|
||||
|
||||
|
||||
- db_type: "int"
|
||||
go_type: "int"
|
||||
- db_type: "pg_catalog.timestamp"
|
||||
go_type: "time.Time"
|
||||
|
|
Loading…
Reference in a new issue