d1

package
v4.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin

This is an alias to an internal value.

View Source
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare

This is an alias to an internal value.

View Source
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser

This is an alias to an internal value.

View Source
const CertificateCADigicert = shared.CertificateCADigicert

This is an alias to an internal value.

View Source
const CertificateCAGoogle = shared.CertificateCAGoogle

This is an alias to an internal value.

View Source
const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt

This is an alias to an internal value.

View Source
const CertificateCASSLCom = shared.CertificateCASSLCom

This is an alias to an internal value.

View Source
const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate

This is an alias to an internal value.

View Source
const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC

This is an alias to an internal value.

View Source
const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusDegraded = shared.CloudflareTunnelStatusDegraded

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusDown = shared.CloudflareTunnelStatusDown

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusHealthy = shared.CloudflareTunnelStatusHealthy

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusInactive = shared.CloudflareTunnelStatusInactive

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeMagic = shared.CloudflareTunnelTunTypeMagic

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeWARP = shared.CloudflareTunnelTunTypeWARP

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector

This is an alias to an internal value.

View Source
const MemberPoliciesAccessAllow = shared.MemberPoliciesAccessAllow

This is an alias to an internal value.

View Source
const MemberPoliciesAccessDeny = shared.MemberPoliciesAccessDeny

This is an alias to an internal value.

View Source
const MemberStatusAccepted = shared.MemberStatusAccepted

This is an alias to an internal value.

View Source
const MemberStatusPending = shared.MemberStatusPending

This is an alias to an internal value.

View Source
const RatePlanIDBusiness = shared.RatePlanIDBusiness

This is an alias to an internal value.

View Source
const RatePlanIDEnterprise = shared.RatePlanIDEnterprise

This is an alias to an internal value.

View Source
const RatePlanIDFree = shared.RatePlanIDFree

This is an alias to an internal value.

View Source
const RatePlanIDLite = shared.RatePlanIDLite

This is an alias to an internal value.

View Source
const RatePlanIDPartnersBusiness = shared.RatePlanIDPartnersBusiness

This is an alias to an internal value.

View Source
const RatePlanIDPartnersEnterprise = shared.RatePlanIDPartnersEnterprise

This is an alias to an internal value.

View Source
const RatePlanIDPartnersFree = shared.RatePlanIDPartnersFree

This is an alias to an internal value.

View Source
const RatePlanIDPartnersPro = shared.RatePlanIDPartnersPro

This is an alias to an internal value.

View Source
const RatePlanIDPro = shared.RatePlanIDPro

This is an alias to an internal value.

View Source
const RatePlanIDProPlus = shared.RatePlanIDProPlus

This is an alias to an internal value.

View Source
const SortDirectionAsc = shared.SortDirectionAsc

This is an alias to an internal value.

View Source
const SortDirectionDesc = shared.SortDirectionDesc

This is an alias to an internal value.

View Source
const SubscriptionFrequencyMonthly = shared.SubscriptionFrequencyMonthly

This is an alias to an internal value.

View Source
const SubscriptionFrequencyQuarterly = shared.SubscriptionFrequencyQuarterly

This is an alias to an internal value.

View Source
const SubscriptionFrequencyWeekly = shared.SubscriptionFrequencyWeekly

This is an alias to an internal value.

View Source
const SubscriptionFrequencyYearly = shared.SubscriptionFrequencyYearly

This is an alias to an internal value.

View Source
const SubscriptionStateAwaitingPayment = shared.SubscriptionStateAwaitingPayment

This is an alias to an internal value.

View Source
const SubscriptionStateCancelled = shared.SubscriptionStateCancelled

This is an alias to an internal value.

View Source
const SubscriptionStateExpired = shared.SubscriptionStateExpired

This is an alias to an internal value.

View Source
const SubscriptionStateFailed = shared.SubscriptionStateFailed

This is an alias to an internal value.

View Source
const SubscriptionStatePaid = shared.SubscriptionStatePaid

This is an alias to an internal value.

View Source
const SubscriptionStateProvisioned = shared.SubscriptionStateProvisioned

This is an alias to an internal value.

View Source
const SubscriptionStateTrial = shared.SubscriptionStateTrial

This is an alias to an internal value.

View Source
const TokenPolicyEffectAllow = shared.TokenPolicyEffectAllow

This is an alias to an internal value.

View Source
const TokenPolicyEffectDeny = shared.TokenPolicyEffectDeny

This is an alias to an internal value.

View Source
const TokenStatusActive = shared.TokenStatusActive

This is an alias to an internal value.

View Source
const TokenStatusDisabled = shared.TokenStatusDisabled

This is an alias to an internal value.

View Source
const TokenStatusExpired = shared.TokenStatusExpired

This is an alias to an internal value.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASN

type ASN = shared.ASN

This is an alias to an internal type.

type ASNParam

type ASNParam = shared.ASNParam

This is an alias to an internal type.

type AuditLog

type AuditLog = shared.AuditLog

This is an alias to an internal type.

type AuditLogAction

type AuditLogAction = shared.AuditLogAction

This is an alias to an internal type.

type AuditLogActor

type AuditLogActor = shared.AuditLogActor

This is an alias to an internal type.

type AuditLogActorType

type AuditLogActorType = shared.AuditLogActorType

The type of actor, whether a User, Cloudflare Admin, or an Automated System.

This is an alias to an internal type.

type AuditLogOwner

type AuditLogOwner = shared.AuditLogOwner

This is an alias to an internal type.

type AuditLogResource

type AuditLogResource = shared.AuditLogResource

This is an alias to an internal type.

type CertificateCA

type CertificateCA = shared.CertificateCA

The Certificate Authority that will issue the certificate

This is an alias to an internal type.

type CertificateRequestType

type CertificateRequestType = shared.CertificateRequestType

Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).

This is an alias to an internal type.

type CloudflareTunnel

type CloudflareTunnel = shared.CloudflareTunnel

A Cloudflare Tunnel that connects your origin to Cloudflare's edge.

This is an alias to an internal type.

type CloudflareTunnelConnection

type CloudflareTunnelConnection = shared.CloudflareTunnelConnection

This is an alias to an internal type.

type CloudflareTunnelStatus

type CloudflareTunnelStatus = shared.CloudflareTunnelStatus

The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).

This is an alias to an internal type.

type CloudflareTunnelTunType

type CloudflareTunnelTunType = shared.CloudflareTunnelTunType

The type of tunnel.

This is an alias to an internal type.

type D1

type D1 struct {
	// Specifies the timestamp the resource was created as an ISO8601 string.
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// The D1 database's size, in bytes.
	FileSize float64 `json:"file_size"`
	// D1 database name.
	Name      string  `json:"name"`
	NumTables float64 `json:"num_tables"`
	// Configuration for D1 read replication.
	ReadReplication D1ReadReplication `json:"read_replication"`
	// D1 database identifier (UUID).
	UUID    string `json:"uuid"`
	Version string `json:"version"`
	JSON    d1JSON `json:"-"`
}

The details of the D1 database.

func (*D1) UnmarshalJSON

func (r *D1) UnmarshalJSON(data []byte) (err error)

type D1ReadReplication added in v4.3.0

type D1ReadReplication struct {
	// The read replication mode for the database. Use 'auto' to create replicas and
	// allow D1 automatically place them around the world, or 'disabled' to not use any
	// database replicas (it can take a few hours for all replicas to be deleted).
	Mode D1ReadReplicationMode `json:"mode,required"`
	JSON d1ReadReplicationJSON `json:"-"`
}

Configuration for D1 read replication.

func (*D1ReadReplication) UnmarshalJSON added in v4.3.0

func (r *D1ReadReplication) UnmarshalJSON(data []byte) (err error)

type D1ReadReplicationMode added in v4.3.0

type D1ReadReplicationMode string

The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).

const (
	D1ReadReplicationModeAuto     D1ReadReplicationMode = "auto"
	D1ReadReplicationModeDisabled D1ReadReplicationMode = "disabled"
)

func (D1ReadReplicationMode) IsKnown added in v4.3.0

func (r D1ReadReplicationMode) IsKnown() bool

type D1Service

type D1Service struct {
	Options  []option.RequestOption
	Database *DatabaseService
}

D1Service contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewD1Service method instead.

func NewD1Service

func NewD1Service(opts ...option.RequestOption) (r *D1Service)

NewD1Service generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type DatabaseDeleteParams

type DatabaseDeleteParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type DatabaseDeleteResponse

type DatabaseDeleteResponse = interface{}

type DatabaseDeleteResponseEnvelope

type DatabaseDeleteResponseEnvelope struct {
	Errors   []shared.ResponseInfo  `json:"errors,required"`
	Messages []shared.ResponseInfo  `json:"messages,required"`
	Result   DatabaseDeleteResponse `json:"result,required,nullable"`
	// Whether the API call was successful
	Success DatabaseDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    databaseDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*DatabaseDeleteResponseEnvelope) UnmarshalJSON

func (r *DatabaseDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type DatabaseDeleteResponseEnvelopeSuccess

type DatabaseDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	DatabaseDeleteResponseEnvelopeSuccessTrue DatabaseDeleteResponseEnvelopeSuccess = true
)

func (DatabaseDeleteResponseEnvelopeSuccess) IsKnown

type DatabaseEditParams added in v4.3.0

type DatabaseEditParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// Configuration for D1 read replication.
	ReadReplication param.Field[DatabaseEditParamsReadReplication] `json:"read_replication"`
}

func (DatabaseEditParams) MarshalJSON added in v4.3.0

func (r DatabaseEditParams) MarshalJSON() (data []byte, err error)

type DatabaseEditParamsReadReplication added in v4.3.0

type DatabaseEditParamsReadReplication struct {
	// The read replication mode for the database. Use 'auto' to create replicas and
	// allow D1 automatically place them around the world, or 'disabled' to not use any
	// database replicas (it can take a few hours for all replicas to be deleted).
	Mode param.Field[DatabaseEditParamsReadReplicationMode] `json:"mode,required"`
}

Configuration for D1 read replication.

func (DatabaseEditParamsReadReplication) MarshalJSON added in v4.3.0

func (r DatabaseEditParamsReadReplication) MarshalJSON() (data []byte, err error)

type DatabaseEditParamsReadReplicationMode added in v4.3.0

type DatabaseEditParamsReadReplicationMode string

The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).

const (
	DatabaseEditParamsReadReplicationModeAuto     DatabaseEditParamsReadReplicationMode = "auto"
	DatabaseEditParamsReadReplicationModeDisabled DatabaseEditParamsReadReplicationMode = "disabled"
)

func (DatabaseEditParamsReadReplicationMode) IsKnown added in v4.3.0

type DatabaseEditResponseEnvelope added in v4.3.0

type DatabaseEditResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// The details of the D1 database.
	Result D1 `json:"result,required"`
	// Whether the API call was successful
	Success DatabaseEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    databaseEditResponseEnvelopeJSON    `json:"-"`
}

func (*DatabaseEditResponseEnvelope) UnmarshalJSON added in v4.3.0

func (r *DatabaseEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type DatabaseEditResponseEnvelopeSuccess added in v4.3.0

type DatabaseEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	DatabaseEditResponseEnvelopeSuccessTrue DatabaseEditResponseEnvelopeSuccess = true
)

func (DatabaseEditResponseEnvelopeSuccess) IsKnown added in v4.3.0

type DatabaseExportParams

type DatabaseExportParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// Specifies that you will poll this endpoint until the export completes
	OutputFormat param.Field[DatabaseExportParamsOutputFormat] `json:"output_format,required"`
	// To poll an in-progress export, provide the current bookmark (returned by your
	// first polling response)
	CurrentBookmark param.Field[string]                          `json:"current_bookmark"`
	DumpOptions     param.Field[DatabaseExportParamsDumpOptions] `json:"dump_options"`
}

func (DatabaseExportParams) MarshalJSON

func (r DatabaseExportParams) MarshalJSON() (data []byte, err error)

type DatabaseExportParamsDumpOptions

type DatabaseExportParamsDumpOptions struct {
	// Export only the table definitions, not their contents
	NoData param.Field[bool] `json:"no_data"`
	// Export only each table's contents, not its definition
	NoSchema param.Field[bool] `json:"no_schema"`
	// Filter the export to just one or more tables. Passing an empty array is the same
	// as not passing anything and means: export all tables.
	Tables param.Field[[]string] `json:"tables"`
}

func (DatabaseExportParamsDumpOptions) MarshalJSON

func (r DatabaseExportParamsDumpOptions) MarshalJSON() (data []byte, err error)

type DatabaseExportParamsOutputFormat

type DatabaseExportParamsOutputFormat string

Specifies that you will poll this endpoint until the export completes

const (
	DatabaseExportParamsOutputFormatPolling DatabaseExportParamsOutputFormat = "polling"
)

func (DatabaseExportParamsOutputFormat) IsKnown

type DatabaseExportResponse

type DatabaseExportResponse struct {
	// The current time-travel bookmark for your D1, used to poll for updates. Will not
	// change for the duration of the export task.
	AtBookmark string `json:"at_bookmark"`
	// Only present when status = 'error'. Contains the error message.
	Error string `json:"error"`
	// Logs since the last time you polled
	Messages []string `json:"messages"`
	// Only present when status = 'complete'
	Result  DatabaseExportResponseResult `json:"result"`
	Status  DatabaseExportResponseStatus `json:"status"`
	Success bool                         `json:"success"`
	Type    DatabaseExportResponseType   `json:"type"`
	JSON    databaseExportResponseJSON   `json:"-"`
}

func (*DatabaseExportResponse) UnmarshalJSON

func (r *DatabaseExportResponse) UnmarshalJSON(data []byte) (err error)

type DatabaseExportResponseEnvelope

type DatabaseExportResponseEnvelope struct {
	Errors   []shared.ResponseInfo  `json:"errors,required"`
	Messages []shared.ResponseInfo  `json:"messages,required"`
	Result   DatabaseExportResponse `json:"result,required"`
	// Whether the API call was successful
	Success DatabaseExportResponseEnvelopeSuccess `json:"success,required"`
	JSON    databaseExportResponseEnvelopeJSON    `json:"-"`
}

func (*DatabaseExportResponseEnvelope) UnmarshalJSON

func (r *DatabaseExportResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type DatabaseExportResponseEnvelopeSuccess

type DatabaseExportResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	DatabaseExportResponseEnvelopeSuccessTrue DatabaseExportResponseEnvelopeSuccess = true
)

func (DatabaseExportResponseEnvelopeSuccess) IsKnown

type DatabaseExportResponseResult

type DatabaseExportResponseResult struct {
	// The generated SQL filename.
	Filename string `json:"filename"`
	// The URL to download the exported SQL. Available for one hour.
	SignedURL string                           `json:"signed_url"`
	JSON      databaseExportResponseResultJSON `json:"-"`
}

Only present when status = 'complete'

func (*DatabaseExportResponseResult) UnmarshalJSON

func (r *DatabaseExportResponseResult) UnmarshalJSON(data []byte) (err error)

type DatabaseExportResponseStatus

type DatabaseExportResponseStatus string
const (
	DatabaseExportResponseStatusComplete DatabaseExportResponseStatus = "complete"
	DatabaseExportResponseStatusError    DatabaseExportResponseStatus = "error"
)

func (DatabaseExportResponseStatus) IsKnown

func (r DatabaseExportResponseStatus) IsKnown() bool

type DatabaseExportResponseType

type DatabaseExportResponseType string
const (
	DatabaseExportResponseTypeExport DatabaseExportResponseType = "export"
)

func (DatabaseExportResponseType) IsKnown

func (r DatabaseExportResponseType) IsKnown() bool

type DatabaseGetParams

type DatabaseGetParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type DatabaseGetResponseEnvelope

type DatabaseGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// The details of the D1 database.
	Result D1 `json:"result,required"`
	// Whether the API call was successful
	Success DatabaseGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    databaseGetResponseEnvelopeJSON    `json:"-"`
}

func (*DatabaseGetResponseEnvelope) UnmarshalJSON

func (r *DatabaseGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type DatabaseGetResponseEnvelopeSuccess

type DatabaseGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	DatabaseGetResponseEnvelopeSuccessTrue DatabaseGetResponseEnvelopeSuccess = true
)

func (DatabaseGetResponseEnvelopeSuccess) IsKnown

type DatabaseImportParams

type DatabaseImportParams struct {
	// Account identifier tag.
	AccountID param.Field[string]           `path:"account_id,required"`
	Body      DatabaseImportParamsBodyUnion `json:"body,required"`
}

func (DatabaseImportParams) MarshalJSON

func (r DatabaseImportParams) MarshalJSON() (data []byte, err error)

type DatabaseImportParamsBody

type DatabaseImportParamsBody struct {
	// Indicates you have a new SQL file to upload.
	Action param.Field[DatabaseImportParamsBodyAction] `json:"action,required"`
	// This identifies the currently-running import, checking its status.
	CurrentBookmark param.Field[string] `json:"current_bookmark"`
	// Required when action is 'init' or 'ingest'. An md5 hash of the file you're
	// uploading. Used to check if it already exists, and validate its contents before
	// ingesting.
	Etag param.Field[string] `json:"etag"`
	// The filename you have successfully uploaded.
	Filename param.Field[string] `json:"filename"`
}

func (DatabaseImportParamsBody) MarshalJSON

func (r DatabaseImportParamsBody) MarshalJSON() (data []byte, err error)

type DatabaseImportParamsBodyAction

type DatabaseImportParamsBodyAction string

Indicates you have a new SQL file to upload.

const (
	DatabaseImportParamsBodyActionInit   DatabaseImportParamsBodyAction = "init"
	DatabaseImportParamsBodyActionIngest DatabaseImportParamsBodyAction = "ingest"
	DatabaseImportParamsBodyActionPoll   DatabaseImportParamsBodyAction = "poll"
)

func (DatabaseImportParamsBodyAction) IsKnown

type DatabaseImportParamsBodyIngest added in v4.5.0

type DatabaseImportParamsBodyIngest struct {
	// Indicates you've finished uploading to tell the D1 to start consuming it
	Action param.Field[DatabaseImportParamsBodyIngestAction] `json:"action,required"`
	// An md5 hash of the file you're uploading. Used to check if it already exists,
	// and validate its contents before ingesting.
	Etag param.Field[string] `json:"etag,required"`
	// The filename you have successfully uploaded.
	Filename param.Field[string] `json:"filename,required"`
}

func (DatabaseImportParamsBodyIngest) MarshalJSON added in v4.5.0

func (r DatabaseImportParamsBodyIngest) MarshalJSON() (data []byte, err error)

type DatabaseImportParamsBodyIngestAction added in v4.5.0

type DatabaseImportParamsBodyIngestAction string

Indicates you've finished uploading to tell the D1 to start consuming it

const (
	DatabaseImportParamsBodyIngestActionIngest DatabaseImportParamsBodyIngestAction = "ingest"
)

func (DatabaseImportParamsBodyIngestAction) IsKnown added in v4.5.0

type DatabaseImportParamsBodyInit added in v4.5.0

type DatabaseImportParamsBodyInit struct {
	// Indicates you have a new SQL file to upload.
	Action param.Field[DatabaseImportParamsBodyInitAction] `json:"action,required"`
	// Required when action is 'init' or 'ingest'. An md5 hash of the file you're
	// uploading. Used to check if it already exists, and validate its contents before
	// ingesting.
	Etag param.Field[string] `json:"etag,required"`
}

func (DatabaseImportParamsBodyInit) MarshalJSON added in v4.5.0

func (r DatabaseImportParamsBodyInit) MarshalJSON() (data []byte, err error)

type DatabaseImportParamsBodyInitAction added in v4.5.0

type DatabaseImportParamsBodyInitAction string

Indicates you have a new SQL file to upload.

const (
	DatabaseImportParamsBodyInitActionInit DatabaseImportParamsBodyInitAction = "init"
)

func (DatabaseImportParamsBodyInitAction) IsKnown added in v4.5.0

type DatabaseImportParamsBodyPoll added in v4.5.0

type DatabaseImportParamsBodyPoll struct {
	// Indicates you've finished uploading to tell the D1 to start consuming it
	Action param.Field[DatabaseImportParamsBodyPollAction] `json:"action,required"`
	// This identifies the currently-running import, checking its status.
	CurrentBookmark param.Field[string] `json:"current_bookmark,required"`
}

func (DatabaseImportParamsBodyPoll) MarshalJSON added in v4.5.0

func (r DatabaseImportParamsBodyPoll) MarshalJSON() (data []byte, err error)

type DatabaseImportParamsBodyPollAction added in v4.5.0

type DatabaseImportParamsBodyPollAction string

Indicates you've finished uploading to tell the D1 to start consuming it

const (
	DatabaseImportParamsBodyPollActionPoll DatabaseImportParamsBodyPollAction = "poll"
)

func (DatabaseImportParamsBodyPollAction) IsKnown added in v4.5.0

type DatabaseImportParamsBodyUnion

type DatabaseImportParamsBodyUnion interface {
	// contains filtered or unexported methods
}

Satisfied by d1.DatabaseImportParamsBodyInit, d1.DatabaseImportParamsBodyIngest, d1.DatabaseImportParamsBodyPoll, DatabaseImportParamsBody.

type DatabaseImportResponse

type DatabaseImportResponse struct {
	// The current time-travel bookmark for your D1, used to poll for updates. Will not
	// change for the duration of the import. Only returned if an import process is
	// currently running or recently finished.
	AtBookmark string `json:"at_bookmark"`
	// Only present when status = 'error'. Contains the error message that prevented
	// the import from succeeding.
	Error string `json:"error"`
	// Derived from the database ID and etag, to use in avoiding repeated uploads. Only
	// returned when for the 'init' action.
	Filename string `json:"filename"`
	// Logs since the last time you polled
	Messages []string `json:"messages"`
	// Only present when status = 'complete'
	Result  DatabaseImportResponseResult `json:"result"`
	Status  DatabaseImportResponseStatus `json:"status"`
	Success bool                         `json:"success"`
	Type    DatabaseImportResponseType   `json:"type"`
	// The R2 presigned URL to use for uploading. Only returned when for the 'init'
	// action.
	UploadURL string                     `json:"upload_url"`
	JSON      databaseImportResponseJSON `json:"-"`
}

func (*DatabaseImportResponse) UnmarshalJSON

func (r *DatabaseImportResponse) UnmarshalJSON(data []byte) (err error)

type DatabaseImportResponseEnvelope

type DatabaseImportResponseEnvelope struct {
	Errors   []shared.ResponseInfo  `json:"errors,required"`
	Messages []shared.ResponseInfo  `json:"messages,required"`
	Result   DatabaseImportResponse `json:"result,required"`
	// Whether the API call was successful
	Success DatabaseImportResponseEnvelopeSuccess `json:"success,required"`
	JSON    databaseImportResponseEnvelopeJSON    `json:"-"`
}

func (*DatabaseImportResponseEnvelope) UnmarshalJSON

func (r *DatabaseImportResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type DatabaseImportResponseEnvelopeSuccess

type DatabaseImportResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	DatabaseImportResponseEnvelopeSuccessTrue DatabaseImportResponseEnvelopeSuccess = true
)

func (DatabaseImportResponseEnvelopeSuccess) IsKnown

type DatabaseImportResponseResult

type DatabaseImportResponseResult struct {
	// The time-travel bookmark if you need restore your D1 to directly after the
	// import succeeded.
	FinalBookmark string                           `json:"final_bookmark"`
	Meta          DatabaseImportResponseResultMeta `json:"meta"`
	// The total number of queries that were executed during the import.
	NumQueries float64                          `json:"num_queries"`
	JSON       databaseImportResponseResultJSON `json:"-"`
}

Only present when status = 'complete'

func (*DatabaseImportResponseResult) UnmarshalJSON

func (r *DatabaseImportResponseResult) UnmarshalJSON(data []byte) (err error)

type DatabaseImportResponseResultMeta

type DatabaseImportResponseResultMeta struct {
	// Denotes if the database has been altered in some way, like deleting rows.
	ChangedDB bool `json:"changed_db"`
	// Rough indication of how many rows were modified by the query, as provided by
	// SQLite's `sqlite3_total_changes()`.
	Changes float64 `json:"changes"`
	// The duration of the SQL query execution inside the database. Does not include
	// any network communication.
	Duration float64 `json:"duration"`
	// The row ID of the last inserted row in a table with an `INTEGER PRIMARY KEY` as
	// provided by SQLite. Tables created with `WITHOUT ROWID` do not populate this.
	LastRowID float64 `json:"last_row_id"`
	// Number of rows read during the SQL query execution, including indices (not all
	// rows are necessarily returned).
	RowsRead float64 `json:"rows_read"`
	// Number of rows written during the SQL query execution, including indices.
	RowsWritten float64 `json:"rows_written"`
	// Denotes if the query has been handled by the database primary instance.
	ServedByPrimary bool `json:"served_by_primary"`
	// Region location hint of the database instance that handled the query.
	ServedByRegion DatabaseImportResponseResultMetaServedByRegion `json:"served_by_region"`
	// Size of the database after the query committed, in bytes.
	SizeAfter float64 `json:"size_after"`
	// Various durations for the query.
	Timings DatabaseImportResponseResultMetaTimings `json:"timings"`
	JSON    databaseImportResponseResultMetaJSON    `json:"-"`
}

func (*DatabaseImportResponseResultMeta) UnmarshalJSON

func (r *DatabaseImportResponseResultMeta) UnmarshalJSON(data []byte) (err error)

type DatabaseImportResponseResultMetaServedByRegion added in v4.3.0

type DatabaseImportResponseResultMetaServedByRegion string

Region location hint of the database instance that handled the query.

const (
	DatabaseImportResponseResultMetaServedByRegionWnam DatabaseImportResponseResultMetaServedByRegion = "WNAM"
	DatabaseImportResponseResultMetaServedByRegionEnam DatabaseImportResponseResultMetaServedByRegion = "ENAM"
	DatabaseImportResponseResultMetaServedByRegionWeur DatabaseImportResponseResultMetaServedByRegion = "WEUR"
	DatabaseImportResponseResultMetaServedByRegionEeur DatabaseImportResponseResultMetaServedByRegion = "EEUR"
	DatabaseImportResponseResultMetaServedByRegionApac DatabaseImportResponseResultMetaServedByRegion = "APAC"
	DatabaseImportResponseResultMetaServedByRegionOc   DatabaseImportResponseResultMetaServedByRegion = "OC"
)

func (DatabaseImportResponseResultMetaServedByRegion) IsKnown added in v4.3.0

type DatabaseImportResponseResultMetaTimings added in v4.3.0

type DatabaseImportResponseResultMetaTimings struct {
	// The duration of the SQL query execution inside the database. Does not include
	// any network communication.
	SqlDurationMs float64                                     `json:"sql_duration_ms"`
	JSON          databaseImportResponseResultMetaTimingsJSON `json:"-"`
}

Various durations for the query.

func (*DatabaseImportResponseResultMetaTimings) UnmarshalJSON added in v4.3.0

func (r *DatabaseImportResponseResultMetaTimings) UnmarshalJSON(data []byte) (err error)

type DatabaseImportResponseStatus

type DatabaseImportResponseStatus string
const (
	DatabaseImportResponseStatusComplete DatabaseImportResponseStatus = "complete"
	DatabaseImportResponseStatusError    DatabaseImportResponseStatus = "error"
)

func (DatabaseImportResponseStatus) IsKnown

func (r DatabaseImportResponseStatus) IsKnown() bool

type DatabaseImportResponseType

type DatabaseImportResponseType string
const (
	DatabaseImportResponseTypeImport DatabaseImportResponseType = "import"
)

func (DatabaseImportResponseType) IsKnown

func (r DatabaseImportResponseType) IsKnown() bool

type DatabaseListParams

type DatabaseListParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// a database name to search for.
	Name param.Field[string] `query:"name"`
	// Page number of paginated results.
	Page param.Field[float64] `query:"page"`
	// Number of items per page.
	PerPage param.Field[float64] `query:"per_page"`
}

func (DatabaseListParams) URLQuery

func (r DatabaseListParams) URLQuery() (v url.Values)

URLQuery serializes DatabaseListParams's query parameters as `url.Values`.

type DatabaseListResponse

type DatabaseListResponse struct {
	// Specifies the timestamp the resource was created as an ISO8601 string.
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// D1 database name.
	Name string `json:"name"`
	// D1 database identifier (UUID).
	UUID    string                   `json:"uuid"`
	Version string                   `json:"version"`
	JSON    databaseListResponseJSON `json:"-"`
}

func (*DatabaseListResponse) UnmarshalJSON

func (r *DatabaseListResponse) UnmarshalJSON(data []byte) (err error)

type DatabaseNewParams

type DatabaseNewParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// D1 database name.
	Name param.Field[string] `json:"name,required"`
	// Specify the region to create the D1 primary, if available. If this option is
	// omitted, the D1 will be created as close as possible to the current user.
	PrimaryLocationHint param.Field[DatabaseNewParamsPrimaryLocationHint] `json:"primary_location_hint"`
}

func (DatabaseNewParams) MarshalJSON

func (r DatabaseNewParams) MarshalJSON() (data []byte, err error)

type DatabaseNewParamsPrimaryLocationHint

type DatabaseNewParamsPrimaryLocationHint string

Specify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user.

const (
	DatabaseNewParamsPrimaryLocationHintWnam DatabaseNewParamsPrimaryLocationHint = "wnam"
	DatabaseNewParamsPrimaryLocationHintEnam DatabaseNewParamsPrimaryLocationHint = "enam"
	DatabaseNewParamsPrimaryLocationHintWeur DatabaseNewParamsPrimaryLocationHint = "weur"
	DatabaseNewParamsPrimaryLocationHintEeur DatabaseNewParamsPrimaryLocationHint = "eeur"
	DatabaseNewParamsPrimaryLocationHintApac DatabaseNewParamsPrimaryLocationHint = "apac"
	DatabaseNewParamsPrimaryLocationHintOc   DatabaseNewParamsPrimaryLocationHint = "oc"
)

func (DatabaseNewParamsPrimaryLocationHint) IsKnown

type DatabaseNewResponseEnvelope

type DatabaseNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// The details of the D1 database.
	Result D1 `json:"result,required"`
	// Whether the API call was successful
	Success DatabaseNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    databaseNewResponseEnvelopeJSON    `json:"-"`
}

func (*DatabaseNewResponseEnvelope) UnmarshalJSON

func (r *DatabaseNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type DatabaseNewResponseEnvelopeSuccess

type DatabaseNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	DatabaseNewResponseEnvelopeSuccessTrue DatabaseNewResponseEnvelopeSuccess = true
)

func (DatabaseNewResponseEnvelopeSuccess) IsKnown

type DatabaseQueryParams

type DatabaseQueryParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// Your SQL query. Supports multiple statements, joined by semicolons, which will
	// be executed as a batch.
	Sql    param.Field[string]   `json:"sql,required"`
	Params param.Field[[]string] `json:"params"`
}

func (DatabaseQueryParams) MarshalJSON

func (r DatabaseQueryParams) MarshalJSON() (data []byte, err error)

type DatabaseRawParams

type DatabaseRawParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// Your SQL query. Supports multiple statements, joined by semicolons, which will
	// be executed as a batch.
	Sql    param.Field[string]   `json:"sql,required"`
	Params param.Field[[]string] `json:"params"`
}

func (DatabaseRawParams) MarshalJSON

func (r DatabaseRawParams) MarshalJSON() (data []byte, err error)

type DatabaseRawResponse

type DatabaseRawResponse struct {
	Meta    DatabaseRawResponseMeta    `json:"meta"`
	Results DatabaseRawResponseResults `json:"results"`
	Success bool                       `json:"success"`
	JSON    databaseRawResponseJSON    `json:"-"`
}

func (*DatabaseRawResponse) UnmarshalJSON

func (r *DatabaseRawResponse) UnmarshalJSON(data []byte) (err error)

type DatabaseRawResponseMeta

type DatabaseRawResponseMeta struct {
	// Denotes if the database has been altered in some way, like deleting rows.
	ChangedDB bool `json:"changed_db"`
	// Rough indication of how many rows were modified by the query, as provided by
	// SQLite's `sqlite3_total_changes()`.
	Changes float64 `json:"changes"`
	// The duration of the SQL query execution inside the database. Does not include
	// any network communication.
	Duration float64 `json:"duration"`
	// The row ID of the last inserted row in a table with an `INTEGER PRIMARY KEY` as
	// provided by SQLite. Tables created with `WITHOUT ROWID` do not populate this.
	LastRowID float64 `json:"last_row_id"`
	// Number of rows read during the SQL query execution, including indices (not all
	// rows are necessarily returned).
	RowsRead float64 `json:"rows_read"`
	// Number of rows written during the SQL query execution, including indices.
	RowsWritten float64 `json:"rows_written"`
	// Denotes if the query has been handled by the database primary instance.
	ServedByPrimary bool `json:"served_by_primary"`
	// Region location hint of the database instance that handled the query.
	ServedByRegion DatabaseRawResponseMetaServedByRegion `json:"served_by_region"`
	// Size of the database after the query committed, in bytes.
	SizeAfter float64 `json:"size_after"`
	// Various durations for the query.
	Timings DatabaseRawResponseMetaTimings `json:"timings"`
	JSON    databaseRawResponseMetaJSON    `json:"-"`
}

func (*DatabaseRawResponseMeta) UnmarshalJSON

func (r *DatabaseRawResponseMeta) UnmarshalJSON(data []byte) (err error)

type DatabaseRawResponseMetaServedByRegion added in v4.3.0

type DatabaseRawResponseMetaServedByRegion string

Region location hint of the database instance that handled the query.

const (
	DatabaseRawResponseMetaServedByRegionWnam DatabaseRawResponseMetaServedByRegion = "WNAM"
	DatabaseRawResponseMetaServedByRegionEnam DatabaseRawResponseMetaServedByRegion = "ENAM"
	DatabaseRawResponseMetaServedByRegionWeur DatabaseRawResponseMetaServedByRegion = "WEUR"
	DatabaseRawResponseMetaServedByRegionEeur DatabaseRawResponseMetaServedByRegion = "EEUR"
	DatabaseRawResponseMetaServedByRegionApac DatabaseRawResponseMetaServedByRegion = "APAC"
	DatabaseRawResponseMetaServedByRegionOc   DatabaseRawResponseMetaServedByRegion = "OC"
)

func (DatabaseRawResponseMetaServedByRegion) IsKnown added in v4.3.0

type DatabaseRawResponseMetaTimings added in v4.3.0

type DatabaseRawResponseMetaTimings struct {
	// The duration of the SQL query execution inside the database. Does not include
	// any network communication.
	SqlDurationMs float64                            `json:"sql_duration_ms"`
	JSON          databaseRawResponseMetaTimingsJSON `json:"-"`
}

Various durations for the query.

func (*DatabaseRawResponseMetaTimings) UnmarshalJSON added in v4.3.0

func (r *DatabaseRawResponseMetaTimings) UnmarshalJSON(data []byte) (err error)

type DatabaseRawResponseResults

type DatabaseRawResponseResults struct {
	Columns []string                       `json:"columns"`
	Rows    [][]interface{}                `json:"rows"`
	JSON    databaseRawResponseResultsJSON `json:"-"`
}

func (*DatabaseRawResponseResults) UnmarshalJSON

func (r *DatabaseRawResponseResults) UnmarshalJSON(data []byte) (err error)

type DatabaseService

type DatabaseService struct {
	Options []option.RequestOption
}

DatabaseService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewDatabaseService method instead.

func NewDatabaseService

func NewDatabaseService(opts ...option.RequestOption) (r *DatabaseService)

NewDatabaseService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*DatabaseService) Delete

func (r *DatabaseService) Delete(ctx context.Context, databaseID string, body DatabaseDeleteParams, opts ...option.RequestOption) (res *DatabaseDeleteResponse, err error)

Deletes the specified D1 database.

func (*DatabaseService) Edit added in v4.3.0

func (r *DatabaseService) Edit(ctx context.Context, databaseID string, params DatabaseEditParams, opts ...option.RequestOption) (res *D1, err error)

Updates partially the specified D1 database.

func (*DatabaseService) Export

func (r *DatabaseService) Export(ctx context.Context, databaseID string, params DatabaseExportParams, opts ...option.RequestOption) (res *DatabaseExportResponse, err error)

Returns a URL where the SQL contents of your D1 can be downloaded. Note: this process may take some time for larger DBs, during which your D1 will be unavailable to serve queries. To avoid blocking your DB unnecessarily, an in-progress export must be continually polled or will automatically cancel.

func (*DatabaseService) Get

func (r *DatabaseService) Get(ctx context.Context, databaseID string, query DatabaseGetParams, opts ...option.RequestOption) (res *D1, err error)

Returns the specified D1 database.

func (*DatabaseService) Import

func (r *DatabaseService) Import(ctx context.Context, databaseID string, params DatabaseImportParams, opts ...option.RequestOption) (res *DatabaseImportResponse, err error)

Generates a temporary URL for uploading an SQL file to, then instructing the D1 to import it and polling it for status updates. Imports block the D1 for their duration.

func (*DatabaseService) List

Returns a list of D1 databases.

func (*DatabaseService) ListAutoPaging

Returns a list of D1 databases.

func (*DatabaseService) New

func (r *DatabaseService) New(ctx context.Context, params DatabaseNewParams, opts ...option.RequestOption) (res *D1, err error)

Returns the created D1 database.

func (*DatabaseService) Query

func (r *DatabaseService) Query(ctx context.Context, databaseID string, params DatabaseQueryParams, opts ...option.RequestOption) (res *pagination.SinglePage[QueryResult], err error)

Returns the query result as an object.

func (*DatabaseService) QueryAutoPaging added in v4.1.0

Returns the query result as an object.

func (*DatabaseService) Raw

Returns the query result rows as arrays rather than objects. This is a performance-optimized version of the /query endpoint.

func (*DatabaseService) RawAutoPaging added in v4.1.0

Returns the query result rows as arrays rather than objects. This is a performance-optimized version of the /query endpoint.

func (*DatabaseService) Update added in v4.3.0

func (r *DatabaseService) Update(ctx context.Context, databaseID string, params DatabaseUpdateParams, opts ...option.RequestOption) (res *D1, err error)

Updates the specified D1 database.

type DatabaseUpdateParams added in v4.3.0

type DatabaseUpdateParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// Configuration for D1 read replication.
	ReadReplication param.Field[DatabaseUpdateParamsReadReplication] `json:"read_replication,required"`
}

func (DatabaseUpdateParams) MarshalJSON added in v4.3.0

func (r DatabaseUpdateParams) MarshalJSON() (data []byte, err error)

type DatabaseUpdateParamsReadReplication added in v4.3.0

type DatabaseUpdateParamsReadReplication struct {
	// The read replication mode for the database. Use 'auto' to create replicas and
	// allow D1 automatically place them around the world, or 'disabled' to not use any
	// database replicas (it can take a few hours for all replicas to be deleted).
	Mode param.Field[DatabaseUpdateParamsReadReplicationMode] `json:"mode,required"`
}

Configuration for D1 read replication.

func (DatabaseUpdateParamsReadReplication) MarshalJSON added in v4.3.0

func (r DatabaseUpdateParamsReadReplication) MarshalJSON() (data []byte, err error)

type DatabaseUpdateParamsReadReplicationMode added in v4.3.0

type DatabaseUpdateParamsReadReplicationMode string

The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).

const (
	DatabaseUpdateParamsReadReplicationModeAuto     DatabaseUpdateParamsReadReplicationMode = "auto"
	DatabaseUpdateParamsReadReplicationModeDisabled DatabaseUpdateParamsReadReplicationMode = "disabled"
)

func (DatabaseUpdateParamsReadReplicationMode) IsKnown added in v4.3.0

type DatabaseUpdateResponseEnvelope added in v4.3.0

type DatabaseUpdateResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// The details of the D1 database.
	Result D1 `json:"result,required"`
	// Whether the API call was successful
	Success DatabaseUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    databaseUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*DatabaseUpdateResponseEnvelope) UnmarshalJSON added in v4.3.0

func (r *DatabaseUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type DatabaseUpdateResponseEnvelopeSuccess added in v4.3.0

type DatabaseUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	DatabaseUpdateResponseEnvelopeSuccessTrue DatabaseUpdateResponseEnvelopeSuccess = true
)

func (DatabaseUpdateResponseEnvelopeSuccess) IsKnown added in v4.3.0

type Error

type Error = apierror.Error

type ErrorData

type ErrorData = shared.ErrorData

This is an alias to an internal type.

type ErrorDataSource added in v4.2.0

type ErrorDataSource = shared.ErrorDataSource

This is an alias to an internal type.

type Member

type Member = shared.Member

This is an alias to an internal type.

type MemberPoliciesAccess

type MemberPoliciesAccess = shared.MemberPoliciesAccess

Allow or deny operations against the resources.

This is an alias to an internal type.

type MemberPoliciesPermissionGroup

type MemberPoliciesPermissionGroup = shared.MemberPoliciesPermissionGroup

A named group of permissions that map to a group of operations against resources.

This is an alias to an internal type.

type MemberPoliciesPermissionGroupsMeta

type MemberPoliciesPermissionGroupsMeta = shared.MemberPoliciesPermissionGroupsMeta

Attributes associated to the permission group.

This is an alias to an internal type.

type MemberPoliciesResourceGroup

type MemberPoliciesResourceGroup = shared.MemberPoliciesResourceGroup

A group of scoped resources.

This is an alias to an internal type.

type MemberPoliciesResourceGroupsMeta

type MemberPoliciesResourceGroupsMeta = shared.MemberPoliciesResourceGroupsMeta

Attributes associated to the resource group.

This is an alias to an internal type.

type MemberPoliciesResourceGroupsScope

type MemberPoliciesResourceGroupsScope = shared.MemberPoliciesResourceGroupsScope

A scope is a combination of scope objects which provides additional context.

This is an alias to an internal type.

type MemberPoliciesResourceGroupsScopeObject

type MemberPoliciesResourceGroupsScopeObject = shared.MemberPoliciesResourceGroupsScopeObject

A scope object represents any resource that can have actions applied against invite.

This is an alias to an internal type.

type MemberPolicy

type MemberPolicy = shared.MemberPolicy

This is an alias to an internal type.

type MemberStatus

type MemberStatus = shared.MemberStatus

A member's status in the account.

This is an alias to an internal type.

type MemberUser

type MemberUser = shared.MemberUser

Details of the user associated to the membership.

This is an alias to an internal type.

type Permission

type Permission = shared.Permission

This is an alias to an internal type.

type PermissionGrant

type PermissionGrant = shared.PermissionGrant

This is an alias to an internal type.

type PermissionGrantParam

type PermissionGrantParam = shared.PermissionGrantParam

This is an alias to an internal type.

type QueryResult

type QueryResult struct {
	Meta    QueryResultMeta `json:"meta"`
	Results []interface{}   `json:"results"`
	Success bool            `json:"success"`
	JSON    queryResultJSON `json:"-"`
}

func (*QueryResult) UnmarshalJSON

func (r *QueryResult) UnmarshalJSON(data []byte) (err error)

type QueryResultMeta

type QueryResultMeta struct {
	// Denotes if the database has been altered in some way, like deleting rows.
	ChangedDB bool `json:"changed_db"`
	// Rough indication of how many rows were modified by the query, as provided by
	// SQLite's `sqlite3_total_changes()`.
	Changes float64 `json:"changes"`
	// The duration of the SQL query execution inside the database. Does not include
	// any network communication.
	Duration float64 `json:"duration"`
	// The row ID of the last inserted row in a table with an `INTEGER PRIMARY KEY` as
	// provided by SQLite. Tables created with `WITHOUT ROWID` do not populate this.
	LastRowID float64 `json:"last_row_id"`
	// Number of rows read during the SQL query execution, including indices (not all
	// rows are necessarily returned).
	RowsRead float64 `json:"rows_read"`
	// Number of rows written during the SQL query execution, including indices.
	RowsWritten float64 `json:"rows_written"`
	// Denotes if the query has been handled by the database primary instance.
	ServedByPrimary bool `json:"served_by_primary"`
	// Region location hint of the database instance that handled the query.
	ServedByRegion QueryResultMetaServedByRegion `json:"served_by_region"`
	// Size of the database after the query committed, in bytes.
	SizeAfter float64 `json:"size_after"`
	// Various durations for the query.
	Timings QueryResultMetaTimings `json:"timings"`
	JSON    queryResultMetaJSON    `json:"-"`
}

func (*QueryResultMeta) UnmarshalJSON

func (r *QueryResultMeta) UnmarshalJSON(data []byte) (err error)

type QueryResultMetaServedByRegion added in v4.3.0

type QueryResultMetaServedByRegion string

Region location hint of the database instance that handled the query.

const (
	QueryResultMetaServedByRegionWnam QueryResultMetaServedByRegion = "WNAM"
	QueryResultMetaServedByRegionEnam QueryResultMetaServedByRegion = "ENAM"
	QueryResultMetaServedByRegionWeur QueryResultMetaServedByRegion = "WEUR"
	QueryResultMetaServedByRegionEeur QueryResultMetaServedByRegion = "EEUR"
	QueryResultMetaServedByRegionApac QueryResultMetaServedByRegion = "APAC"
	QueryResultMetaServedByRegionOc   QueryResultMetaServedByRegion = "OC"
)

func (QueryResultMetaServedByRegion) IsKnown added in v4.3.0

func (r QueryResultMetaServedByRegion) IsKnown() bool

type QueryResultMetaTimings added in v4.3.0

type QueryResultMetaTimings struct {
	// The duration of the SQL query execution inside the database. Does not include
	// any network communication.
	SqlDurationMs float64                    `json:"sql_duration_ms"`
	JSON          queryResultMetaTimingsJSON `json:"-"`
}

Various durations for the query.

func (*QueryResultMetaTimings) UnmarshalJSON added in v4.3.0

func (r *QueryResultMetaTimings) UnmarshalJSON(data []byte) (err error)

type RatePlan

type RatePlan = shared.RatePlan

The rate plan applied to the subscription.

This is an alias to an internal type.

type RatePlanID added in v4.1.0

type RatePlanID = shared.RatePlanID

The ID of the rate plan.

This is an alias to an internal type.

type RatePlanParam

type RatePlanParam = shared.RatePlanParam

The rate plan applied to the subscription.

This is an alias to an internal type.

type ResponseInfo

type ResponseInfo = shared.ResponseInfo

This is an alias to an internal type.

type ResponseInfoSource added in v4.3.0

type ResponseInfoSource = shared.ResponseInfoSource

This is an alias to an internal type.

type Role

type Role = shared.Role

This is an alias to an internal type.

type RoleParam

type RoleParam = shared.RoleParam

This is an alias to an internal type.

type RolePermissions

type RolePermissions = shared.RolePermissions

This is an alias to an internal type.

type RolePermissionsParam

type RolePermissionsParam = shared.RolePermissionsParam

This is an alias to an internal type.

type SortDirection

type SortDirection = shared.SortDirection

Direction to order DNS records in.

This is an alias to an internal type.

type Subscription

type Subscription = shared.Subscription

This is an alias to an internal type.

type SubscriptionFrequency

type SubscriptionFrequency = shared.SubscriptionFrequency

How often the subscription is renewed automatically.

This is an alias to an internal type.

type SubscriptionParam

type SubscriptionParam = shared.SubscriptionParam

This is an alias to an internal type.

type SubscriptionState

type SubscriptionState = shared.SubscriptionState

The state that the subscription is in.

This is an alias to an internal type.

type Token

type Token = shared.Token

This is an alias to an internal type.

type TokenCondition

type TokenCondition = shared.TokenCondition

This is an alias to an internal type.

type TokenConditionCIDRList

type TokenConditionCIDRList = shared.TokenConditionCIDRList

IPv4/IPv6 CIDR.

This is an alias to an internal type.

type TokenConditionCIDRListParam

type TokenConditionCIDRListParam = shared.TokenConditionCIDRListParam

IPv4/IPv6 CIDR.

This is an alias to an internal type.

type TokenConditionParam

type TokenConditionParam = shared.TokenConditionParam

This is an alias to an internal type.

type TokenConditionRequestIP

type TokenConditionRequestIP = shared.TokenConditionRequestIP

Client IP restrictions.

This is an alias to an internal type.

type TokenConditionRequestIPParam

type TokenConditionRequestIPParam = shared.TokenConditionRequestIPParam

Client IP restrictions.

This is an alias to an internal type.

type TokenParam

type TokenParam = shared.TokenParam

This is an alias to an internal type.

type TokenPolicy

type TokenPolicy = shared.TokenPolicy

This is an alias to an internal type.

type TokenPolicyEffect

type TokenPolicyEffect = shared.TokenPolicyEffect

Allow or deny operations against the resources.

This is an alias to an internal type.

type TokenPolicyParam

type TokenPolicyParam = shared.TokenPolicyParam

This is an alias to an internal type.

type TokenPolicyPermissionGroup

type TokenPolicyPermissionGroup = shared.TokenPolicyPermissionGroup

A named group of permissions that map to a group of operations against resources.

This is an alias to an internal type.

type TokenPolicyPermissionGroupParam

type TokenPolicyPermissionGroupParam = shared.TokenPolicyPermissionGroupParam

A named group of permissions that map to a group of operations against resources.

This is an alias to an internal type.

type TokenPolicyPermissionGroupsMeta

type TokenPolicyPermissionGroupsMeta = shared.TokenPolicyPermissionGroupsMeta

Attributes associated to the permission group.

This is an alias to an internal type.

type TokenPolicyPermissionGroupsMetaParam

type TokenPolicyPermissionGroupsMetaParam = shared.TokenPolicyPermissionGroupsMetaParam

Attributes associated to the permission group.

This is an alias to an internal type.

type TokenPolicyResourcesMap added in v4.6.0

type TokenPolicyResourcesMap = shared.TokenPolicyResourcesMap

A nested permission grant for further scoping.

This is an alias to an internal type.

type TokenPolicyResourcesMapParam added in v4.6.0

type TokenPolicyResourcesMapParam = shared.TokenPolicyResourcesMapParam

A nested permission grant for further scoping.

This is an alias to an internal type.

type TokenPolicyResourcesUnion added in v4.6.0

type TokenPolicyResourcesUnion = shared.TokenPolicyResourcesUnion

A simple wildcard permission, e.g., "\*".

This is an alias to an internal type.

type TokenPolicyResourcesUnionParam added in v4.6.0

type TokenPolicyResourcesUnionParam = shared.TokenPolicyResourcesUnionParam

A simple wildcard permission, e.g., "\*".

This is an alias to an internal type.

type TokenStatus

type TokenStatus = shared.TokenStatus

Status of the token.

This is an alias to an internal type.

type TokenValue

type TokenValue = shared.TokenValue

The token value.

This is an alias to an internal type.

Jump to

Keyboard shortcuts

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