Documentation ¶
Index ¶
- Constants
- type Provider
- type SQLCommon
- func (s *SQLCommon) Capabilities() *database.Capabilities
- func (s *SQLCommon) Close()
- func (s *SQLCommon) DB() *sql.DB
- func (s *SQLCommon) DeleteBlob(ctx context.Context, sequence int64) (err error)
- func (s *SQLCommon) DeleteConfigRecord(ctx context.Context, key string) (err error)
- func (s *SQLCommon) DeleteNamespace(ctx context.Context, id *fftypes.UUID) (err error)
- func (s *SQLCommon) DeleteNextPin(ctx context.Context, sequence int64) (err error)
- func (s *SQLCommon) DeleteNonce(ctx context.Context, context *fftypes.Bytes32) (err error)
- func (s *SQLCommon) DeleteOffset(ctx context.Context, t fftypes.OffsetType, name string) (err error)
- func (s *SQLCommon) DeletePin(ctx context.Context, sequence int64) (err error)
- func (s *SQLCommon) DeleteSubscriptionByID(ctx context.Context, id *fftypes.UUID) (err error)
- func (s *SQLCommon) GetBatchByID(ctx context.Context, id *fftypes.UUID) (message *fftypes.Batch, err error)
- func (s *SQLCommon) GetBatches(ctx context.Context, filter database.Filter) (message []*fftypes.Batch, res *database.FilterResult, err error)
- func (s *SQLCommon) GetBlobMatchingHash(ctx context.Context, hash *fftypes.Bytes32) (message *fftypes.Blob, err error)
- func (s *SQLCommon) GetBlobs(ctx context.Context, filter database.Filter) (message []*fftypes.Blob, res *database.FilterResult, err error)
- func (s *SQLCommon) GetConfigRecord(ctx context.Context, key string) (result *fftypes.ConfigRecord, err error)
- func (s *SQLCommon) GetConfigRecords(ctx context.Context, filter database.Filter) (result []*fftypes.ConfigRecord, res *database.FilterResult, err error)
- func (s *SQLCommon) GetData(ctx context.Context, filter database.Filter) (message []*fftypes.Data, res *database.FilterResult, err error)
- func (s *SQLCommon) GetDataByID(ctx context.Context, id *fftypes.UUID, withValue bool) (message *fftypes.Data, err error)
- func (s *SQLCommon) GetDataRefs(ctx context.Context, filter database.Filter) (message fftypes.DataRefs, res *database.FilterResult, err error)
- func (s *SQLCommon) GetDatatypeByID(ctx context.Context, id *fftypes.UUID) (message *fftypes.Datatype, err error)
- func (s *SQLCommon) GetDatatypeByName(ctx context.Context, ns, name, version string) (message *fftypes.Datatype, err error)
- func (s *SQLCommon) GetDatatypes(ctx context.Context, filter database.Filter) (message []*fftypes.Datatype, res *database.FilterResult, err error)
- func (s *SQLCommon) GetEventByID(ctx context.Context, id *fftypes.UUID) (message *fftypes.Event, err error)
- func (s *SQLCommon) GetEvents(ctx context.Context, filter database.Filter) (message []*fftypes.Event, res *database.FilterResult, err error)
- func (s *SQLCommon) GetGroupByHash(ctx context.Context, hash *fftypes.Bytes32) (group *fftypes.Group, err error)
- func (s *SQLCommon) GetGroups(ctx context.Context, filter database.Filter) (group []*fftypes.Group, res *database.FilterResult, err error)
- func (s *SQLCommon) GetMessageByID(ctx context.Context, id *fftypes.UUID) (message *fftypes.Message, err error)
- func (s *SQLCommon) GetMessageRefs(ctx context.Context, filter database.Filter) ([]*fftypes.MessageRef, *database.FilterResult, error)
- func (s *SQLCommon) GetMessages(ctx context.Context, filter database.Filter) (message []*fftypes.Message, fr *database.FilterResult, err error)
- func (s *SQLCommon) GetMessagesForData(ctx context.Context, dataID *fftypes.UUID, filter database.Filter) (message []*fftypes.Message, fr *database.FilterResult, err error)
- func (s *SQLCommon) GetNamespace(ctx context.Context, name string) (message *fftypes.Namespace, err error)
- func (s *SQLCommon) GetNamespaces(ctx context.Context, filter database.Filter) (message []*fftypes.Namespace, fr *database.FilterResult, err error)
- func (s *SQLCommon) GetNextPinByContextAndIdentity(ctx context.Context, context *fftypes.Bytes32, identity string) (message *fftypes.NextPin, err error)
- func (s *SQLCommon) GetNextPinByHash(ctx context.Context, hash *fftypes.Bytes32) (message *fftypes.NextPin, err error)
- func (s *SQLCommon) GetNextPins(ctx context.Context, filter database.Filter) (message []*fftypes.NextPin, fr *database.FilterResult, err error)
- func (s *SQLCommon) GetNode(ctx context.Context, owner, name string) (message *fftypes.Node, err error)
- func (s *SQLCommon) GetNodeByID(ctx context.Context, id *fftypes.UUID) (message *fftypes.Node, err error)
- func (s *SQLCommon) GetNodes(ctx context.Context, filter database.Filter) (message []*fftypes.Node, fr *database.FilterResult, err error)
- func (s *SQLCommon) GetNonce(ctx context.Context, context *fftypes.Bytes32) (message *fftypes.Nonce, err error)
- func (s *SQLCommon) GetNonces(ctx context.Context, filter database.Filter) (message []*fftypes.Nonce, fr *database.FilterResult, err error)
- func (s *SQLCommon) GetOffset(ctx context.Context, t fftypes.OffsetType, name string) (message *fftypes.Offset, err error)
- func (s *SQLCommon) GetOffsets(ctx context.Context, filter database.Filter) (message []*fftypes.Offset, fr *database.FilterResult, err error)
- func (s *SQLCommon) GetOperationByID(ctx context.Context, id *fftypes.UUID) (operation *fftypes.Operation, err error)
- func (s *SQLCommon) GetOperations(ctx context.Context, filter database.Filter) (operation []*fftypes.Operation, fr *database.FilterResult, err error)
- func (s *SQLCommon) GetOrganizationByID(ctx context.Context, id *fftypes.UUID) (message *fftypes.Organization, err error)
- func (s *SQLCommon) GetOrganizationByIdentity(ctx context.Context, identity string) (message *fftypes.Organization, err error)
- func (s *SQLCommon) GetOrganizationByName(ctx context.Context, name string) (message *fftypes.Organization, err error)
- func (s *SQLCommon) GetOrganizations(ctx context.Context, filter database.Filter) (message []*fftypes.Organization, fr *database.FilterResult, err error)
- func (s *SQLCommon) GetPins(ctx context.Context, filter database.Filter) (message []*fftypes.Pin, fr *database.FilterResult, err error)
- func (s *SQLCommon) GetSubscriptionByID(ctx context.Context, id *fftypes.UUID) (message *fftypes.Subscription, err error)
- func (s *SQLCommon) GetSubscriptionByName(ctx context.Context, ns, name string) (message *fftypes.Subscription, err error)
- func (s *SQLCommon) GetSubscriptions(ctx context.Context, filter database.Filter) (message []*fftypes.Subscription, fr *database.FilterResult, err error)
- func (s *SQLCommon) GetTokenAccount(ctx context.Context, protocolID, tokenIndex, identity string) (message *fftypes.TokenAccount, err error)
- func (s *SQLCommon) GetTokenAccounts(ctx context.Context, filter database.Filter) ([]*fftypes.TokenAccount, *database.FilterResult, error)
- func (s *SQLCommon) GetTokenPool(ctx context.Context, ns string, name string) (message *fftypes.TokenPool, err error)
- func (s *SQLCommon) GetTokenPoolByID(ctx context.Context, id *fftypes.UUID) (message *fftypes.TokenPool, err error)
- func (s *SQLCommon) GetTokenPoolByProtocolID(ctx context.Context, id string) (*fftypes.TokenPool, error)
- func (s *SQLCommon) GetTokenPools(ctx context.Context, filter database.Filter) (message []*fftypes.TokenPool, fr *database.FilterResult, err error)
- func (s *SQLCommon) GetTransactionByID(ctx context.Context, id *fftypes.UUID) (message *fftypes.Transaction, err error)
- func (s *SQLCommon) GetTransactions(ctx context.Context, filter database.Filter) (message []*fftypes.Transaction, fr *database.FilterResult, err error)
- func (s *SQLCommon) Init(ctx context.Context, provider Provider, prefix config.Prefix, ...) (err error)
- func (s *SQLCommon) InitPrefix(provider Provider, prefix config.Prefix)
- func (s *SQLCommon) InsertBlob(ctx context.Context, blob *fftypes.Blob) (err error)
- func (s *SQLCommon) InsertEvent(ctx context.Context, event *fftypes.Event) (err error)
- func (s *SQLCommon) InsertMessageLocal(ctx context.Context, message *fftypes.Message) (err error)
- func (s *SQLCommon) InsertNextPin(ctx context.Context, nextpin *fftypes.NextPin) (err error)
- func (s *SQLCommon) RunAsGroup(ctx context.Context, fn func(ctx context.Context) error) error
- func (s *SQLCommon) SetPinDispatched(ctx context.Context, sequence int64) (err error)
- func (s *SQLCommon) UpdateBatch(ctx context.Context, id *fftypes.UUID, update database.Update) (err error)
- func (s *SQLCommon) UpdateData(ctx context.Context, id *fftypes.UUID, update database.Update) (err error)
- func (s *SQLCommon) UpdateDatatype(ctx context.Context, id *fftypes.UUID, update database.Update) (err error)
- func (s *SQLCommon) UpdateEvent(ctx context.Context, id *fftypes.UUID, update database.Update) (err error)
- func (s *SQLCommon) UpdateGroup(ctx context.Context, hash *fftypes.Bytes32, update database.Update) (err error)
- func (s *SQLCommon) UpdateGroups(ctx context.Context, filter database.Filter, update database.Update) (err error)
- func (s *SQLCommon) UpdateMessage(ctx context.Context, msgid *fftypes.UUID, update database.Update) (err error)
- func (s *SQLCommon) UpdateMessages(ctx context.Context, filter database.Filter, update database.Update) (err error)
- func (s *SQLCommon) UpdateNextPin(ctx context.Context, sequence int64, update database.Update) (err error)
- func (s *SQLCommon) UpdateNode(ctx context.Context, id *fftypes.UUID, update database.Update) (err error)
- func (s *SQLCommon) UpdateOffset(ctx context.Context, rowID int64, update database.Update) (err error)
- func (s *SQLCommon) UpdateOperation(ctx context.Context, id *fftypes.UUID, update database.Update) (err error)
- func (s *SQLCommon) UpdateOrganization(ctx context.Context, id *fftypes.UUID, update database.Update) (err error)
- func (s *SQLCommon) UpdateSubscription(ctx context.Context, namespace, name string, update database.Update) (err error)
- func (s *SQLCommon) UpdateTransaction(ctx context.Context, id *fftypes.UUID, update database.Update) (err error)
- func (s *SQLCommon) UpsertBatch(ctx context.Context, batch *fftypes.Batch, allowHashUpdate bool) (err error)
- func (s *SQLCommon) UpsertConfigRecord(ctx context.Context, configRecord *fftypes.ConfigRecord, allowExisting bool) (err error)
- func (s *SQLCommon) UpsertData(ctx context.Context, data *fftypes.Data, allowExisting, allowHashUpdate bool) (err error)
- func (s *SQLCommon) UpsertDatatype(ctx context.Context, datatype *fftypes.Datatype, allowExisting bool) (err error)
- func (s *SQLCommon) UpsertGroup(ctx context.Context, group *fftypes.Group, allowExisting bool) (err error)
- func (s *SQLCommon) UpsertMessage(ctx context.Context, message *fftypes.Message, ...) (err error)
- func (s *SQLCommon) UpsertNamespace(ctx context.Context, namespace *fftypes.Namespace, allowExisting bool) (err error)
- func (s *SQLCommon) UpsertNode(ctx context.Context, node *fftypes.Node, allowExisting bool) (err error)
- func (s *SQLCommon) UpsertNonceNext(ctx context.Context, nonce *fftypes.Nonce) (err error)
- func (s *SQLCommon) UpsertOffset(ctx context.Context, offset *fftypes.Offset, allowExisting bool) (err error)
- func (s *SQLCommon) UpsertOperation(ctx context.Context, operation *fftypes.Operation, allowExisting bool) (err error)
- func (s *SQLCommon) UpsertOrganization(ctx context.Context, organization *fftypes.Organization, allowExisting bool) (err error)
- func (s *SQLCommon) UpsertPin(ctx context.Context, pin *fftypes.Pin) (err error)
- func (s *SQLCommon) UpsertSubscription(ctx context.Context, subscription *fftypes.Subscription, allowExisting bool) (err error)
- func (s *SQLCommon) UpsertTokenAccount(ctx context.Context, account *fftypes.TokenAccount) (err error)
- func (s *SQLCommon) UpsertTokenPool(ctx context.Context, pool *fftypes.TokenPool) (err error)
- func (s *SQLCommon) UpsertTransaction(ctx context.Context, transaction *fftypes.Transaction, allowHashUpdate bool) (err error)
Constants ¶
View Source
const ( // SQLConfMigrationsAuto enables automatic migrations SQLConfMigrationsAuto = "migrations.auto" // SQLConfMigrationsDirectory is the directory containing the numerically ordered migration DDL files to apply to the database SQLConfMigrationsDirectory = "migrations.directory" // SQLConfDatasourceURL is the datasource connection URL string SQLConfDatasourceURL = "url" // SQLConfMaxConnections maximum connections to the database SQLConfMaxConnections = "maxConns" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider interface { // Name is the name of the database driver Name() string // MigrationDir is the subdirectory for migrations MigrationsDir() string // Open creates the DB instances Open(url string) (*sql.DB, error) // GetDriver returns the driver implementation GetMigrationDriver(*sql.DB) (migratedb.Driver, error) // PlaceholderFormat gets the Squirrel placeholder format PlaceholderFormat() sq.PlaceholderFormat // UpdateInsertForReturn updates the insert query for returning the Sequenc, and returns whether it needs to be run as a query to return the Sequence field UpdateInsertForSequenceReturn(insert sq.InsertBuilder) (updatedInsert sq.InsertBuilder, runAsQuery bool) }
Provider defines the interface an individual provider muse implement to customize the SQLCommon implementation
type SQLCommon ¶
type SQLCommon struct {
// contains filtered or unexported fields
}
func (*SQLCommon) Capabilities ¶
func (s *SQLCommon) Capabilities() *database.Capabilities
func (*SQLCommon) DeleteBlob ¶
func (*SQLCommon) DeleteConfigRecord ¶
func (*SQLCommon) DeleteNamespace ¶
func (*SQLCommon) DeleteNextPin ¶
func (*SQLCommon) DeleteNonce ¶
func (*SQLCommon) DeleteOffset ¶
func (*SQLCommon) DeleteSubscriptionByID ¶
func (*SQLCommon) GetBatchByID ¶
func (*SQLCommon) GetBatches ¶
func (*SQLCommon) GetBlobMatchingHash ¶
func (*SQLCommon) GetConfigRecord ¶
func (*SQLCommon) GetConfigRecords ¶
func (s *SQLCommon) GetConfigRecords(ctx context.Context, filter database.Filter) (result []*fftypes.ConfigRecord, res *database.FilterResult, err error)
func (*SQLCommon) GetDataByID ¶
func (*SQLCommon) GetDataRefs ¶
func (*SQLCommon) GetDatatypeByID ¶
func (*SQLCommon) GetDatatypeByName ¶
func (*SQLCommon) GetDatatypes ¶
func (*SQLCommon) GetEventByID ¶
func (*SQLCommon) GetGroupByHash ¶
func (*SQLCommon) GetMessageByID ¶
func (*SQLCommon) GetMessageRefs ¶
func (s *SQLCommon) GetMessageRefs(ctx context.Context, filter database.Filter) ([]*fftypes.MessageRef, *database.FilterResult, error)
func (*SQLCommon) GetMessages ¶
func (*SQLCommon) GetMessagesForData ¶
func (*SQLCommon) GetNamespace ¶
func (*SQLCommon) GetNamespaces ¶
func (*SQLCommon) GetNextPinByContextAndIdentity ¶
func (*SQLCommon) GetNextPinByHash ¶
func (*SQLCommon) GetNextPins ¶
func (*SQLCommon) GetNodeByID ¶
func (*SQLCommon) GetOffsets ¶
func (*SQLCommon) GetOperationByID ¶
func (*SQLCommon) GetOperations ¶
func (*SQLCommon) GetOrganizationByID ¶
func (*SQLCommon) GetOrganizationByIdentity ¶
func (*SQLCommon) GetOrganizationByName ¶
func (*SQLCommon) GetOrganizations ¶
func (s *SQLCommon) GetOrganizations(ctx context.Context, filter database.Filter) (message []*fftypes.Organization, fr *database.FilterResult, err error)
func (*SQLCommon) GetSubscriptionByID ¶
func (*SQLCommon) GetSubscriptionByName ¶
func (*SQLCommon) GetSubscriptions ¶
func (s *SQLCommon) GetSubscriptions(ctx context.Context, filter database.Filter) (message []*fftypes.Subscription, fr *database.FilterResult, err error)
func (*SQLCommon) GetTokenAccount ¶
func (*SQLCommon) GetTokenAccounts ¶
func (s *SQLCommon) GetTokenAccounts(ctx context.Context, filter database.Filter) ([]*fftypes.TokenAccount, *database.FilterResult, error)
func (*SQLCommon) GetTokenPool ¶
func (*SQLCommon) GetTokenPoolByID ¶
func (*SQLCommon) GetTokenPoolByProtocolID ¶
func (*SQLCommon) GetTokenPools ¶
func (*SQLCommon) GetTransactionByID ¶
func (*SQLCommon) GetTransactions ¶
func (s *SQLCommon) GetTransactions(ctx context.Context, filter database.Filter) (message []*fftypes.Transaction, fr *database.FilterResult, err error)
func (*SQLCommon) InitPrefix ¶
func (*SQLCommon) InsertBlob ¶
func (*SQLCommon) InsertEvent ¶
func (*SQLCommon) InsertMessageLocal ¶
func (*SQLCommon) InsertNextPin ¶
func (*SQLCommon) RunAsGroup ¶
func (*SQLCommon) SetPinDispatched ¶
func (*SQLCommon) UpdateBatch ¶
func (*SQLCommon) UpdateData ¶
func (*SQLCommon) UpdateDatatype ¶
func (*SQLCommon) UpdateEvent ¶
func (*SQLCommon) UpdateGroup ¶
func (*SQLCommon) UpdateGroups ¶
func (*SQLCommon) UpdateMessage ¶
func (*SQLCommon) UpdateMessages ¶
func (*SQLCommon) UpdateNextPin ¶
func (*SQLCommon) UpdateNode ¶
func (*SQLCommon) UpdateOffset ¶
func (*SQLCommon) UpdateOperation ¶
func (*SQLCommon) UpdateOrganization ¶
func (*SQLCommon) UpdateSubscription ¶
func (*SQLCommon) UpdateTransaction ¶
func (*SQLCommon) UpsertBatch ¶
func (*SQLCommon) UpsertConfigRecord ¶
func (*SQLCommon) UpsertData ¶
func (*SQLCommon) UpsertDatatype ¶
func (*SQLCommon) UpsertGroup ¶
func (*SQLCommon) UpsertMessage ¶
func (*SQLCommon) UpsertNamespace ¶
func (*SQLCommon) UpsertNode ¶
func (*SQLCommon) UpsertNonceNext ¶
func (*SQLCommon) UpsertOffset ¶
func (*SQLCommon) UpsertOperation ¶
func (*SQLCommon) UpsertOrganization ¶
func (*SQLCommon) UpsertSubscription ¶
func (*SQLCommon) UpsertTokenAccount ¶
func (*SQLCommon) UpsertTokenPool ¶
func (*SQLCommon) UpsertTransaction ¶
Source Files ¶
- batch_sql.go
- blob_sql.go
- config.go
- config_record_sql.go
- data_sql.go
- datatype_sql.go
- event_sql.go
- filter_sql.go
- group_sql.go
- message_sql.go
- namespace_sql.go
- nextpin_sql.go
- node_sql.go
- nonce_sql.go
- offset_sql.go
- operation_sql.go
- organization_sql.go
- pin_sql.go
- provider.go
- sqlcommon.go
- subscription_sql.go
- tokenaccount_sql.go
- tokenpool_sql.go
- transaction_sql.go
Click to show internal directories.
Click to hide internal directories.