spannerDb

package
v2.0.0-...-3591f3e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	UserGuid       string    `spanner:"USER_GUID"`
	UserId         int64     `spanner:"USER_ID"`
	FirstName      string    `spanner:"FIRST_NM"`
	LastName       string    `spanner:"LAST_NM"`
	Phone          string    `spanner:"PHONE"`
	Email          string    `spanner:"EMAIL"`
	CreatedTs      time.Time `spanner:"CREATE_TS"`
	LastModifiedTs time.Time `spanner:"LAST_MOD_TS"`
}

type AccountXref

type AccountXref struct {
	XrefVal        string    `spanner:"XREF_VAL"`
	XrefType       string    `spanner:"XREF_TYPE"`
	UserGuid       string    `spanner:"USER_GUID"`
	UserId         int64     `spanner:"USER_ID"`
	CreatedTs      time.Time `spanner:"CREATE_TS"`
	LastModifiedTs time.Time `spanner:"LAST_MOD_TS"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, props *config.Spanner) (*Client, error)

func (*Client) Close

func (c *Client) Close()

type Repository

type Repository[T any] struct {
	// contains filtered or unexported fields
}

func NewRepository

func NewRepository[T any](client *Client, table string) *Repository[T]

func (*Repository[T]) Save

func (r *Repository[T]) Save(ctx context.Context, entity T) error

func (*Repository[T]) SaveAll

func (r *Repository[T]) SaveAll(ctx context.Context, entities []T) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL