// Code generated by sqlc. DO NOT EDIT. // source: organization.sql package db import ( "context" "time" ) const createOrganization = `-- name: CreateOrganization :one INSERT INTO organization (created_at, name) VALUES ($1, $2) RETURNING organization_id, created_at, name ` type CreateOrganizationParams struct { CreatedAt time.Time `json:"created_at"` Name string `json:"name"` } func (q *Queries) CreateOrganization(ctx context.Context, arg CreateOrganizationParams) (Organization, error) { row := q.db.QueryRowContext(ctx, createOrganization, arg.CreatedAt, arg.Name) var i Organization err := row.Scan(&i.OrganizationID, &i.CreatedAt, &i.Name) return i, err } const getAllOrganizations = `-- name: GetAllOrganizations :many SELECT organization_id, created_at, name FROM organization ` func (q *Queries) GetAllOrganizations(ctx context.Context) ([]Organization, error) { rows, err := q.db.QueryContext(ctx, getAllOrganizations) if err != nil { return nil, err } defer rows.Close() var items []Organization for rows.Next() { var i Organization if err := rows.Scan(&i.OrganizationID, &i.CreatedAt, &i.Name); err != nil { return nil, err } items = append(items, i) } if err := rows.Close(); err != nil { return nil, err } if err := rows.Err(); err != nil { return nil, err } return items, nil }