sqlite

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 19 Imported by: 1

Documentation

Overview

Package sqlite provides SQLite driver implementation with custom functions. Custom functions are registered globally on first use to extend SQLite's limited ASCII-only text operations with proper Unicode support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDB

func NewDB(profile *profile.Profile) (store.Driver, error)

NewDB opens a database specified by its database driver name and a driver-specific data source name, usually consisting of at least a database name and connection information.

Types

type DB

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

func (*DB) AcceptSpaceInvitation added in v0.31.0

func (d *DB) AcceptSpaceInvitation(ctx context.Context, accept *store.AcceptSpaceInvitation, actorUserID int32) (*store.SpaceMember, error)

func (*DB) ApplyAuthenticationConfigMutation added in v0.30.0

func (d *DB) ApplyAuthenticationConfigMutation(ctx context.Context, mutation *store.AuthenticationConfigMutation) error

ApplyAuthenticationConfigMutation validates and applies an auth mutation in a serializable transaction.

func (*DB) ApplyMemoMutation added in v0.31.0

func (d *DB) ApplyMemoMutation(ctx context.Context, mutation *store.MemoMutation) error

ApplyMemoMutation atomically updates a memo, attachment bindings, and reference relations.

func (*DB) Close

func (d *DB) Close() error

func (*DB) CreateAttachment added in v0.25.0

func (d *DB) CreateAttachment(ctx context.Context, create *store.Attachment) (*store.Attachment, error)

func (*DB) CreateIdentityProvider

func (d *DB) CreateIdentityProvider(ctx context.Context, create *store.IdentityProvider) (*store.IdentityProvider, error)

func (*DB) CreateInbox added in v0.17.0

func (d *DB) CreateInbox(ctx context.Context, create *store.Inbox) (*store.Inbox, error)

func (*DB) CreateInstanceSettingIfNotExists added in v0.31.0

func (d *DB) CreateInstanceSettingIfNotExists(ctx context.Context, create *store.InstanceSetting) (bool, error)

CreateInstanceSettingIfNotExists atomically creates the setting when its name is absent and reports whether it inserted the row.

func (*DB) CreateMemo

func (d *DB) CreateMemo(ctx context.Context, create *store.Memo) (*store.Memo, error)

func (*DB) CreateMemoShare added in v0.27.0

func (d *DB) CreateMemoShare(ctx context.Context, create *store.MemoShare) (*store.MemoShare, error)

func (*DB) CreateSpace added in v0.31.0

func (d *DB) CreateSpace(ctx context.Context, create *store.Space, creatorID int32) (*store.Space, error)

func (*DB) CreateSpaceInvitation added in v0.31.0

func (d *DB) CreateSpaceInvitation(ctx context.Context, create *store.SpaceInvitation, actorUserID int32) (*store.SpaceInvitation, error)

func (*DB) CreateUser

func (d *DB) CreateUser(ctx context.Context, create *store.User) (*store.User, error)

func (*DB) CreateUserIdentity added in v0.28.0

func (d *DB) CreateUserIdentity(ctx context.Context, create *store.UserIdentity) (*store.UserIdentity, error)

func (*DB) CreateUserWithIdentity added in v0.30.0

func (d *DB) CreateUserWithIdentity(ctx context.Context, createUser *store.User, createIdentity *store.UserIdentity) (*store.User, error)

func (*DB) DeclineSpaceInvitation added in v0.31.0

func (d *DB) DeclineSpaceInvitation(ctx context.Context, decline *store.DeclineSpaceInvitation, actorUserID int32) error

func (*DB) DeleteAttachment added in v0.25.0

func (d *DB) DeleteAttachment(ctx context.Context, delete *store.DeleteAttachment) error

func (*DB) DeleteAttachments added in v0.27.0

func (d *DB) DeleteAttachments(ctx context.Context, deletes []*store.DeleteAttachment) error

func (*DB) DeleteAttachmentsWithPolicy added in v0.31.0

func (d *DB) DeleteAttachmentsWithPolicy(ctx context.Context, policy *store.AttachmentDeletionPolicy, attachmentIDs []int32) error

func (*DB) DeleteIdentityProvider

func (d *DB) DeleteIdentityProvider(ctx context.Context, delete *store.DeleteIdentityProvider) error

func (*DB) DeleteInbox added in v0.17.0

func (d *DB) DeleteInbox(ctx context.Context, delete *store.DeleteInbox) error

func (*DB) DeleteInstanceSetting added in v0.25.3

func (d *DB) DeleteInstanceSetting(ctx context.Context, delete *store.DeleteInstanceSetting) error

func (*DB) DeleteMemo

func (d *DB) DeleteMemo(ctx context.Context, delete *store.DeleteMemo) error

func (*DB) DeleteMemoRelation

func (d *DB) DeleteMemoRelation(ctx context.Context, delete *store.DeleteMemoRelation) error

func (*DB) DeleteMemoShare added in v0.27.0

func (d *DB) DeleteMemoShare(ctx context.Context, delete *store.DeleteMemoShare) error

func (*DB) DeleteMemoWithPolicy added in v0.31.0

func (d *DB) DeleteMemoWithPolicy(ctx context.Context, delete *store.DeleteMemoWithPolicy) (*store.DeleteMemoWithPolicyResult, error)

func (*DB) DeleteReaction added in v0.20.0

func (d *DB) DeleteReaction(ctx context.Context, delete *store.DeleteReaction) error

func (*DB) DeleteSpace added in v0.31.0

func (d *DB) DeleteSpace(ctx context.Context, delete *store.DeleteSpace) (*store.DeleteSpaceResult, error)

DeleteSpace hard-deletes only memos directly placed in the Space. Relations are removed when either endpoint is deleted, but are never traversed.

func (*DB) DeleteSpaceMember added in v0.31.0

func (d *DB) DeleteSpaceMember(ctx context.Context, delete *store.DeleteSpaceMember, actorUserID int32) error

func (*DB) DeleteUser

func (d *DB) DeleteUser(ctx context.Context, delete *store.DeleteUser) (*store.DeleteUserResult, error)

func (*DB) DeleteUserIdentities added in v0.28.0

func (d *DB) DeleteUserIdentities(ctx context.Context, delete *store.DeleteUserIdentity) error

func (*DB) DeleteUserSettings added in v0.28.0

func (d *DB) DeleteUserSettings(ctx context.Context, delete *store.DeleteUserSetting) error

func (*DB) GetAttachmentStorageUsage added in v0.31.0

func (d *DB) GetAttachmentStorageUsage(ctx context.Context, creatorID int32) (int64, error)

GetAttachmentStorageUsage returns the total persisted attachment size for a creator in bytes.

func (*DB) GetDB

func (d *DB) GetDB() *sql.DB

func (*DB) GetDatabaseSize added in v0.29.0

func (d *DB) GetDatabaseSize(ctx context.Context) (int64, error)

GetDatabaseSize returns the database size in bytes, or -1 if unavailable.

func (*DB) GetMemoShare added in v0.27.0

func (d *DB) GetMemoShare(ctx context.Context, find *store.FindMemoShare) (*store.MemoShare, error)

func (*DB) GetReaction added in v0.25.3

func (d *DB) GetReaction(ctx context.Context, find *store.FindReaction) (*store.Reaction, error)

func (*DB) GetUserByPATHash added in v0.26.0

func (d *DB) GetUserByPATHash(ctx context.Context, tokenHash string) (*store.PATQueryResult, error)

func (*DB) IsInitialized added in v0.25.0

func (d *DB) IsInitialized(ctx context.Context) (bool, error)

func (*DB) IsRetryableAuthenticationMutationError added in v0.30.0

func (*DB) IsRetryableAuthenticationMutationError(err error) bool

IsRetryableAuthenticationMutationError reports whether err is a transient SQLite locking failure.

func (*DB) ListAttachments added in v0.25.0

func (d *DB) ListAttachments(ctx context.Context, find *store.FindAttachment) ([]*store.Attachment, error)

func (*DB) ListIdentityProviders

func (d *DB) ListIdentityProviders(ctx context.Context, find *store.FindIdentityProvider) ([]*store.IdentityProvider, error)

func (*DB) ListInboxes added in v0.17.0

func (d *DB) ListInboxes(ctx context.Context, find *store.FindInbox) ([]*store.Inbox, error)

func (*DB) ListInstanceSettings added in v0.25.3

func (d *DB) ListInstanceSettings(ctx context.Context, find *store.FindInstanceSetting) ([]*store.InstanceSetting, error)

func (*DB) ListMemoRelations

func (d *DB) ListMemoRelations(ctx context.Context, find *store.FindMemoRelation) ([]*store.MemoRelation, error)

func (*DB) ListMemoShares added in v0.27.0

func (d *DB) ListMemoShares(ctx context.Context, find *store.FindMemoShare) ([]*store.MemoShare, error)

func (*DB) ListMemos

func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo, error)

func (*DB) ListReactions added in v0.20.0

func (d *DB) ListReactions(ctx context.Context, find *store.FindReaction) ([]*store.Reaction, error)

func (*DB) ListSpaceInvitations added in v0.31.0

func (d *DB) ListSpaceInvitations(ctx context.Context, find *store.FindSpaceInvitation) ([]*store.SpaceInvitation, error)

func (*DB) ListSpaceMembers added in v0.31.0

func (d *DB) ListSpaceMembers(ctx context.Context, find *store.FindSpaceMember) ([]*store.SpaceMember, error)

func (*DB) ListSpaces added in v0.31.0

func (d *DB) ListSpaces(ctx context.Context, find *store.FindSpace) ([]*store.Space, error)

func (*DB) ListUserIdentities added in v0.28.0

func (d *DB) ListUserIdentities(ctx context.Context, find *store.FindUserIdentity) ([]*store.UserIdentity, error)

func (*DB) ListUserSettings

func (d *DB) ListUserSettings(ctx context.Context, find *store.FindUserSetting) ([]*store.UserSetting, error)

func (*DB) ListUsers

func (d *DB) ListUsers(ctx context.Context, find *store.FindUser) ([]*store.User, error)

func (*DB) RevokeSpaceInvitation added in v0.31.0

func (d *DB) RevokeSpaceInvitation(ctx context.Context, revoke *store.RevokeSpaceInvitation, actorUserID int32) error

func (*DB) UpdateAttachment added in v0.25.0

func (d *DB) UpdateAttachment(ctx context.Context, update *store.UpdateAttachment) error

func (*DB) UpdateIdentityProvider

func (d *DB) UpdateIdentityProvider(ctx context.Context, update *store.UpdateIdentityProvider) (*store.IdentityProvider, error)

func (*DB) UpdateInbox added in v0.17.0

func (d *DB) UpdateInbox(ctx context.Context, update *store.UpdateInbox) (*store.Inbox, error)

func (*DB) UpdateMemo

func (d *DB) UpdateMemo(ctx context.Context, update *store.UpdateMemo) error

func (*DB) UpdateSpace added in v0.31.0

func (d *DB) UpdateSpace(ctx context.Context, update *store.UpdateSpace, actorUserID int32) (*store.Space, error)

func (*DB) UpdateSpaceMember added in v0.31.0

func (d *DB) UpdateSpaceMember(ctx context.Context, update *store.UpdateSpaceMember, actorUserID int32) (*store.SpaceMember, error)

func (*DB) UpdateUser

func (d *DB) UpdateUser(ctx context.Context, update *store.UpdateUser) (*store.User, error)

func (*DB) UpsertInstanceSetting added in v0.25.3

func (d *DB) UpsertInstanceSetting(ctx context.Context, upsert *store.InstanceSetting) (*store.InstanceSetting, error)

func (*DB) UpsertMemoRelation

func (d *DB) UpsertMemoRelation(ctx context.Context, create *store.MemoRelation) (*store.MemoRelation, error)

func (*DB) UpsertReaction added in v0.20.0

func (d *DB) UpsertReaction(ctx context.Context, upsert *store.Reaction) (*store.Reaction, error)

func (*DB) UpsertUserSetting

func (d *DB) UpsertUserSetting(ctx context.Context, upsert *store.UserSetting) (*store.UserSetting, error)

Jump to

Keyboard shortcuts

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