package firebirdsql
import "github.com/nakagami/firebirdsql"
****************************************************************************** The MIT License (MIT)
Copyright (c) 2026 Hajime Nakagami
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************************
Package firebird provides database/sql driver for Firebird RDBMS.
Index ¶
- Constants
- Variables
- func GetServiceInfoSPBPreamble() []byte
- func NewErrOpResonse(opRCode int32) error
- type BackupManager
- func NewBackupManager(addr string, user string, password string, options ServiceManagerOptions) (*BackupManager, error)
- func (bm *BackupManager) Backup(database string, backup string, options BackupOptions, verbose chan string) error
- func (bm *BackupManager) Restore(backup string, database string, options RestoreOptions, verbose chan string) error
- type BackupOption
- func WithBackupParallelWorkers(parallelWorkers int32) BackupOption
- func WithConvertExternalTablesToInternalTables() BackupOption
- func WithExpand() BackupOption
- func WithGarbageCollect() BackupOption
- func WithIgnoreChecksums() BackupOption
- func WithIgnoreLimboTransactions() BackupOption
- func WithMetadataOnly() BackupOption
- func WithTransportable() BackupOption
- func WithZip() BackupOption
- func WithoutBackupParallelWorkers() BackupOption
- func WithoutConvertExternalTablesToInternalTables() BackupOption
- func WithoutExpand() BackupOption
- func WithoutGarbageCollect() BackupOption
- func WithoutIgnoreChecksums() BackupOption
- func WithoutIgnoreLimboTransactions() BackupOption
- func WithoutMetadataOnly() BackupOption
- func WithoutTransportable() BackupOption
- func WithoutZip() BackupOption
- type BackupOptions
- func GetDefaultBackupOptions() BackupOptions
- func NewBackupOptions(opts ...BackupOption) BackupOptions
- type ErrOpResponse
- type Event
- type EventHandler
- type FbError
- type FbEvent
- func NewFBEvent(dsns string) (*FbEvent, error)
- func (e *FbEvent) Close() error
- func (e *FbEvent) Count() int
- func (e *FbEvent) IsClosed() bool
- func (e *FbEvent) PostEvent(name string) error
- func (e *FbEvent) Subscribe(events []string, cb EventHandler) (*Subscription, error)
- func (e *FbEvent) SubscribeChan(events []string, chEvent chan Event) (*Subscription, error)
- func (e *FbEvent) Subscribers() []*Subscription
- type FirebirdVersion
- func ParseFirebirdVersion(rawVersionString string) FirebirdVersion
- func (v FirebirdVersion) EqualOrGreater(major int, minor int) bool
- func (v FirebirdVersion) EqualOrGreaterPatch(major int, minor int, patch int) bool
- type MaintenanceManager
- func NewMaintenanceManager(addr string, user string, password string, options ServiceManagerOptions) (*MaintenanceManager, error)
- func (mm *MaintenanceManager) ActivateShadow(shadow string) error
- func (mm *MaintenanceManager) CommitTransaction(database string, transaction int64) error
- func (mm *MaintenanceManager) GetLimboTransactions(database string) ([]int64, error)
- func (mm *MaintenanceManager) KillShadow(database string) error
- func (mm *MaintenanceManager) Mend(database string) error
- func (mm *MaintenanceManager) NoLinger(database string) error
- func (mm *MaintenanceManager) Online(database string) error
- func (mm *MaintenanceManager) OnlineEx(database string, operationMode OperationMode) error
- func (mm *MaintenanceManager) RollbackTransaction(database string, transaction int64) error
- func (mm *MaintenanceManager) SetAccessModeReadOnly(database string) error
- func (mm *MaintenanceManager) SetAccessModeReadWrite(database string) error
- func (mm *MaintenanceManager) SetDialect(database string, dialect int) error
- func (mm *MaintenanceManager) SetPageBuffers(database string, pageCount int) error
- func (mm *MaintenanceManager) SetPageFillNoReserve(database string) error
- func (mm *MaintenanceManager) SetPageFillReserve(database string) error
- func (mm *MaintenanceManager) SetSweepInterval(database string, transactions uint) error
- func (mm *MaintenanceManager) SetWriteModeAsync(database string) error
- func (mm *MaintenanceManager) SetWriteModeSync(database string) error
- func (mm *MaintenanceManager) Shutdown(database string, shutdownMode ShutdownMode, timeout uint) error
- func (mm *MaintenanceManager) ShutdownEx(database string, operationMode OperationMode, shutdownModeEx ShutdownModeEx, timeout uint) error
- func (mm *MaintenanceManager) Sweep(database string) error
- func (mm *MaintenanceManager) Validate(database string, options int) error
- type NBackupManager
- func NewNBackupManager(addr string, user string, password string, options ServiceManagerOptions) (*NBackupManager, error)
- func (bm *NBackupManager) Backup(database string, backup string, options NBackupOptions, verbose chan string) error
- func (bm *NBackupManager) Fixup(database string, options NBackupOptions, verbose chan string) error
- func (bm *NBackupManager) Restore(backups []string, database string, options NBackupOptions, verbose chan string) error
- type NBackupOption
- func WithDBTriggers() NBackupOption
- func WithGuid(guid string) NBackupOption
- func WithInPlaceRestore() NBackupOption
- func WithLevel(level int) NBackupOption
- func WithPlaceRestore() NBackupOption
- func WithPreserveSequence() NBackupOption
- func WithoutDBTriggers() NBackupOption
- func WithoutPreserveSequence() NBackupOption
- type NBackupOptions
- func GetDefaultNBackupOptions() NBackupOptions
- func NewNBackupOptions(opts ...NBackupOption) NBackupOptions
- func (o NBackupOptions) GetOptionsMask() int32
- type OperationMode
- type RestoreOption
- func WithCacheBuffers(cacheBuffers int32) RestoreOption
- func WithCommitAfterEachTable() RestoreOption
- func WithDeactivateIndexes() RestoreOption
- func WithEnforceConstraints() RestoreOption
- func WithPageSize(pageSize int32) RestoreOption
- func WithReplace() RestoreOption
- func WithRestoreParallelWorkers(parallelWorkers int32) RestoreOption
- func WithRestoreShadows() RestoreOption
- func WithUseAllPageSpace() RestoreOption
- func WithoutCommitAfterEachTable() RestoreOption
- func WithoutEnforceConstraints() RestoreOption
- func WithoutReplace() RestoreOption
- func WithoutRestoreParallelWorkers() RestoreOption
- func WithoutRestoreShadows() RestoreOption
- func WithoutUseAllPageSpace() RestoreOption
- type RestoreOptions
- func GetDefaultRestoreOptions() RestoreOptions
- func NewRestoreOptions(opts ...RestoreOption) RestoreOptions
- type ServiceManager
- func NewServiceManager(addr string, user string, password string, options ServiceManagerOptions) (*ServiceManager, error)
- func (svc *ServiceManager) Close() (err error)
- func (svc *ServiceManager) GetArchitecture() (string, error)
- func (svc *ServiceManager) GetDbStats(database string, options StatisticsOptions, result chan string) error
- func (svc *ServiceManager) GetDbStatsString(database string, options StatisticsOptions) (string, error)
- func (svc *ServiceManager) GetFbLog(result chan string) error
- func (svc *ServiceManager) GetFbLogString() (string, error)
- func (svc *ServiceManager) GetHomeDir() (string, error)
- func (svc *ServiceManager) GetLockFileDir() (string, error)
- func (svc *ServiceManager) GetMsgFileDir() (string, error)
- func (svc *ServiceManager) GetSecurityDatabasePath() (string, error)
- func (svc *ServiceManager) GetServerVersion() (FirebirdVersion, error)
- func (svc *ServiceManager) GetServerVersionString() (string, error)
- func (svc *ServiceManager) GetServiceInfo(spb []byte, srb []byte, bufferLength int32) ([]byte, error)
- func (svc *ServiceManager) GetServiceInfoInt(item byte) (int16, error)
- func (svc *ServiceManager) GetServiceInfoString(item byte) (string, error)
- func (svc *ServiceManager) GetString() (result string, end bool, err error)
- func (svc *ServiceManager) GetSvrDbInfo() (*SrvDbInfo, error)
- func (svc *ServiceManager) IsRunning() (bool, error)
- func (svc *ServiceManager) ServiceAttach(spb []byte, verbose chan string) error
- func (svc *ServiceManager) ServiceAttachBuffer(spb []byte, verbose chan []byte) error
- func (svc *ServiceManager) ServiceStart(spb []byte) error
- func (svc *ServiceManager) Wait() error
- func (svc *ServiceManager) WaitBuffer(stream chan []byte) error
- func (svc *ServiceManager) WaitString() (string, error)
- func (svc *ServiceManager) WaitStrings(result chan string) error
- type ServiceManagerOption
- func WithAuthPlugin(authPlugin string) ServiceManagerOption
- func WithWireCrypt() ServiceManagerOption
- func WithoutWireCrypt() ServiceManagerOption
- type ServiceManagerOptions
- func GetDefaultServiceManagerOptions() ServiceManagerOptions
- func NewServiceManagerOptions(opts ...ServiceManagerOption) ServiceManagerOptions
- func (sm ServiceManagerOptions) WithAuthPlugin(authPlugin string) ServiceManagerOptions
- func (sm ServiceManagerOptions) WithWireCrypt() ServiceManagerOptions
- func (sm ServiceManagerOptions) WithoutWireCrypt() ServiceManagerOptions
- type ShutdownMode
- type ShutdownModeEx
- type SrvDbInfo
- type StatisticsOption
- func WithOnlyHeaderPages() StatisticsOption
- func WithRecordVersions() StatisticsOption
- func WithSystemRelationsAndIndexes() StatisticsOption
- func WithTables(tables []string) StatisticsOption
- func WithUserDataPages() StatisticsOption
- func WithUserIndexPages() StatisticsOption
- func WithoutIndexPages() StatisticsOption
- func WithoutOnlyHeaderPages() StatisticsOption
- func WithoutRecordVersions() StatisticsOption
- func WithoutSystemRelationsAndIndexes() StatisticsOption
- func WithoutUserDataPages() StatisticsOption
- type StatisticsOptions
- func GetDefaultStatisticsOptions() StatisticsOptions
- func NewStatisticsOptions(opts ...StatisticsOption) StatisticsOptions
- type Subscription
- func (s *Subscription) Close() error
- func (s *Subscription) IsClose() bool
- func (s *Subscription) NotifyClose(receiver chan error)
- func (s *Subscription) Unsubscribe() error
- type TraceManager
- func NewTraceManager(addr string, user string, password string, options ServiceManagerOptions) (*TraceManager, error)
- func (t *TraceManager) List() (string, error)
- func (t *TraceManager) Start(config string) (*TraceSession, error)
- func (t *TraceManager) StartWithName(name string, config string) (*TraceSession, error)
- type TraceSession
- func (ts *TraceSession) Close() (err error)
- func (ts *TraceSession) Pause() (err error)
- func (ts *TraceSession) Resume() (err error)
- func (ts *TraceSession) Stop() (err error)
- func (ts *TraceSession) Wait() (err error)
- func (ts *TraceSession) WaitStrings(result chan string) (err error)
- type User
- type UserManager
- func NewUserManager(addr string, user string, password string, smo ServiceManagerOptions, umo UserManagerOptions) (*UserManager, error)
- func (um *UserManager) AddUser(user User) error
- func (um *UserManager) Close() error
- func (um *UserManager) DeleteUser(user User) error
- func (um *UserManager) DropAdminRoleMapping() error
- func (um *UserManager) GetUsers() ([]User, error)
- func (um *UserManager) ModifyUser(user User) error
- func (um *UserManager) SetAdminRoleMapping() error
- type UserManagerOption
- type UserManagerOptions
- func GetDefaultUserManagerOptions() UserManagerOptions
- func NewUserManagerOptions(opts ...UserManagerOption) UserManagerOptions
- type UserOption
- func WithAdmin() UserOption
- func WithFirstName(firstname string) UserOption
- func WithGroupId(groupId int32) UserOption
- func WithLastName(lastname string) UserOption
- func WithMiddleName(middlename string) UserOption
- func WithPassword(password string) UserOption
- func WithUserId(userId int32) UserOption
- func WithUsername(username string) UserOption
- func WithoutAdmin() UserOption
- type XPBReader
- func NewXPBReader(buf []byte) *XPBReader
- func (pb *XPBReader) End() bool
- func (pb *XPBReader) Get() byte
- func (pb *XPBReader) GetInt16() int16
- func (pb *XPBReader) GetInt32() int32
- func (pb *XPBReader) GetInt64() int64
- func (pb *XPBReader) GetString() string
- func (pb *XPBReader) Next() (have bool, value byte)
- func (pb *XPBReader) Reset()
- func (pb *XPBReader) Skip(count int)
- type XPBWriter
- func NewXPBWriter() *XPBWriter
- func NewXPBWriterFromBytes(bytes []byte) *XPBWriter
- func NewXPBWriterFromTag(tag byte) *XPBWriter
- func (pb *XPBWriter) Bytes() []byte
- func (pb *XPBWriter) PutByte(tag byte, val byte) *XPBWriter
- func (pb *XPBWriter) PutBytes(bytes []byte) *XPBWriter
- func (pb *XPBWriter) PutInt16(tag byte, val int16) *XPBWriter
- func (pb *XPBWriter) PutInt32(tag byte, val int32) *XPBWriter
- func (pb *XPBWriter) PutInt64(tag byte, val int64) *XPBWriter
- func (pb *XPBWriter) PutString(tag byte, val string) *XPBWriter
- func (pb *XPBWriter) PutTag(tag byte) *XPBWriter
- func (pb *XPBWriter) Reset() *XPBWriter
Constants ¶
const ( ISC_TIME_SECONDS_PRECISION = 10000 // Protocol Version PROTOCOL_VERSION13 = 13 PROTOCOL_VERSION16 = 16 CNCT_user = 1 CNCT_passwd = 2 CNCT_host = 4 CNCT_group = 5 CNCT_user_verification = 6 CNCT_specific_data = 7 CNCT_plugin_name = 8 CNCT_login = 9 CNCT_plugin_list = 10 CNCT_client_crypt = 11 )
const ( ISOLATION_LEVEL_READ_COMMITED_LEGACY = iota ISOLATION_LEVEL_READ_COMMITED ISOLATION_LEVEL_REPEATABLE_READ ISOLATION_LEVEL_SERIALIZABLE ISOLATION_LEVEL_READ_COMMITED_RO // NOWAIT variants (lock conflicts return immediately instead of waiting) ISOLATION_LEVEL_READ_COMMITED_NOWAIT ISOLATION_LEVEL_READ_COMMITED_RO_NOWAIT )
const ( DSQL_close = 1 // close the cursor opened after statement execute DSQL_drop = 2 // release the statement handle )
op_free_statement modes (p_sqlfree_option). Names match the Firebird wire protocol specification.
const ( SRP_KEY_SIZE = 128 SRP_SALT_SIZE = 32 DEBUG_PRIVATE_KEY = "60975527035CF2AD1989806F0407210BC81EDC04E2762A56AFD529DDDA2D4393" DEBUG_SRP = false )
const ( SessionStopped = iota SessionRunning SessionPaused )
const ( PLUGIN_LIST = "Srp256,Srp,Legacy_Auth" BUFFER_LEN = 1024 MAX_CHAR_LENGTH = 32767 BLOB_SEGMENT_SIZE = 32000 )
const ( SQL_TYPE_TEXT = 452 SQL_TYPE_VARYING = 448 SQL_TYPE_SHORT = 500 SQL_TYPE_LONG = 496 SQL_TYPE_FLOAT = 482 SQL_TYPE_DOUBLE = 480 SQL_TYPE_D_FLOAT = 530 SQL_TYPE_TIMESTAMP = 510 SQL_TYPE_BLOB = 520 SQL_TYPE_ARRAY = 540 SQL_TYPE_QUAD = 550 SQL_TYPE_TIME = 560 SQL_TYPE_DATE = 570 SQL_TYPE_INT64 = 580 SQL_TYPE_INT128 = 32752 SQL_TYPE_TIMESTAMP_TZ = 32754 SQL_TYPE_TIME_TZ = 32756 SQL_TYPE_DEC_FIXED = 32758 SQL_TYPE_DEC64 = 32760 SQL_TYPE_DEC128 = 32762 SQL_TYPE_BOOLEAN = 32764 SQL_TYPE_NULL = 32766 )
const (
EPB_version1 = 1
)
Event
const ( // LevelReadCommittedNoWait starts a READ COMMITTED transaction with NOWAIT lock resolution. LevelReadCommittedNoWait = 1000 )
Driver-specific transaction isolation levels for database/sql.
database/sql doesn't have a way to express Firebird's NOWAIT/LOCK TIMEOUT, so this driver exposes a custom value for use in sql.TxOptions.Isolation.
Variables ¶
var ( ErrAlreadySubscribe = errors.New("already subscribe") ErrFbEventClosed = errors.New("fbevent already closed") )
Errors
var ( ErrEventAlreadyRunning = errors.New("events are already running") ErrEventNeed = errors.New("at least one event is needed") ErrWrongLengthEvent = errors.New("length name events are longer than 255") ErrEventBufferLarge = errors.New("whole events buffer is bigger than 65535") )
ErrInvalidIsolationLevel is returned when an unsupported isolation level is requested. This is an internal guard: normal code paths should only use supported levels.
var FirebirdVersionPattern = regexp.MustCompile(`((\w{2})-(\w)(\d+)\.(\d+)\.(\d+)\.(\d+)(?:-\S+)?) (.+)`)
Functions ¶
func GetServiceInfoSPBPreamble ¶
func GetServiceInfoSPBPreamble() []byte
func NewErrOpResonse ¶
Error interface implementation
Types ¶
type BackupManager ¶
type BackupManager struct {
// contains filtered or unexported fields
}
func NewBackupManager ¶
func NewBackupManager(addr string, user string, password string, options ServiceManagerOptions) (*BackupManager, error)
func (*BackupManager) Backup ¶
func (bm *BackupManager) Backup(database string, backup string, options BackupOptions, verbose chan string) error
func (*BackupManager) Restore ¶
func (bm *BackupManager) Restore(backup string, database string, options RestoreOptions, verbose chan string) error
type BackupOption ¶
type BackupOption func(*BackupOptions)
func WithBackupParallelWorkers ¶
func WithBackupParallelWorkers(parallelWorkers int32) BackupOption
func WithConvertExternalTablesToInternalTables ¶
func WithConvertExternalTablesToInternalTables() BackupOption
func WithExpand ¶
func WithExpand() BackupOption
func WithGarbageCollect ¶
func WithGarbageCollect() BackupOption
func WithIgnoreChecksums ¶
func WithIgnoreChecksums() BackupOption
func WithIgnoreLimboTransactions ¶
func WithIgnoreLimboTransactions() BackupOption
func WithMetadataOnly ¶
func WithMetadataOnly() BackupOption
func WithTransportable ¶
func WithTransportable() BackupOption
func WithZip ¶
func WithZip() BackupOption
func WithoutBackupParallelWorkers ¶
func WithoutBackupParallelWorkers() BackupOption
func WithoutConvertExternalTablesToInternalTables ¶
func WithoutConvertExternalTablesToInternalTables() BackupOption
func WithoutExpand ¶
func WithoutExpand() BackupOption
func WithoutGarbageCollect ¶
func WithoutGarbageCollect() BackupOption
func WithoutIgnoreChecksums ¶
func WithoutIgnoreChecksums() BackupOption
func WithoutIgnoreLimboTransactions ¶
func WithoutIgnoreLimboTransactions() BackupOption
func WithoutMetadataOnly ¶
func WithoutMetadataOnly() BackupOption
func WithoutTransportable ¶
func WithoutTransportable() BackupOption
func WithoutZip ¶
func WithoutZip() BackupOption
type BackupOptions ¶
type BackupOptions struct {
IgnoreChecksums bool
IgnoreLimboTransactions bool
MetadataOnly bool
GarbageCollect bool
Transportable bool
ConvertExternalTablesToInternalTables bool
Expand bool
Zip bool
ParallelWorkers int32
}
func GetDefaultBackupOptions ¶
func GetDefaultBackupOptions() BackupOptions
func NewBackupOptions ¶
func NewBackupOptions(opts ...BackupOption) BackupOptions
type ErrOpResponse ¶
type ErrOpResponse struct {
// contains filtered or unexported fields
}
ErrOpResponse operation request error
func (*ErrOpResponse) Error ¶
func (e *ErrOpResponse) Error() string
type Event ¶
Event stores event data: the amount since the last time the event was received and id
type EventHandler ¶
type EventHandler func(e Event)
EventHandler callback function type
type FbError ¶
func (*FbError) Error ¶
type FbEvent ¶
type FbEvent struct {
// contains filtered or unexported fields
}
FbEvent allows you to subscribe to events, also stores subscribers. It is possible to send events to the database.
func NewFBEvent ¶
NewFBEvent returns FbEvent for event subscription
func (*FbEvent) Close ¶
Close closes FbEvent and all subscribers
func (*FbEvent) Count ¶
Count returns the number of subscribers
func (*FbEvent) IsClosed ¶
IsClosed returns a close flag
func (*FbEvent) PostEvent ¶
PostEvent posts an event to the database
func (*FbEvent) Subscribe ¶
func (e *FbEvent) Subscribe(events []string, cb EventHandler) (*Subscription, error)
Subscribe subscribe to events using the callback function
func (*FbEvent) SubscribeChan ¶
func (e *FbEvent) SubscribeChan(events []string, chEvent chan Event) (*Subscription, error)
SubscribeChan subscribe to events using the channel
func (*FbEvent) Subscribers ¶
func (e *FbEvent) Subscribers() []*Subscription
Subscribers returns slice of all subscribers
type FirebirdVersion ¶
type FirebirdVersion struct {
Platform string
Type string
Full string
Major int
Minor int
Patch int
BuildNumber int
Raw string
}
func ParseFirebirdVersion ¶
func ParseFirebirdVersion(rawVersionString string) FirebirdVersion
func (FirebirdVersion) EqualOrGreater ¶
func (v FirebirdVersion) EqualOrGreater(major int, minor int) bool
func (FirebirdVersion) EqualOrGreaterPatch ¶
func (v FirebirdVersion) EqualOrGreaterPatch(major int, minor int, patch int) bool
type MaintenanceManager ¶
type MaintenanceManager struct {
// contains filtered or unexported fields
}
func NewMaintenanceManager ¶
func NewMaintenanceManager(addr string, user string, password string, options ServiceManagerOptions) (*MaintenanceManager, error)
func (*MaintenanceManager) ActivateShadow ¶
func (mm *MaintenanceManager) ActivateShadow(shadow string) error
func (*MaintenanceManager) CommitTransaction ¶
func (mm *MaintenanceManager) CommitTransaction(database string, transaction int64) error
func (*MaintenanceManager) GetLimboTransactions ¶
func (mm *MaintenanceManager) GetLimboTransactions(database string) ([]int64, error)
func (*MaintenanceManager) KillShadow ¶
func (mm *MaintenanceManager) KillShadow(database string) error
func (*MaintenanceManager) Mend ¶
func (mm *MaintenanceManager) Mend(database string) error
func (*MaintenanceManager) NoLinger ¶
func (mm *MaintenanceManager) NoLinger(database string) error
func (*MaintenanceManager) Online ¶
func (mm *MaintenanceManager) Online(database string) error
func (*MaintenanceManager) OnlineEx ¶
func (mm *MaintenanceManager) OnlineEx(database string, operationMode OperationMode) error
func (*MaintenanceManager) RollbackTransaction ¶
func (mm *MaintenanceManager) RollbackTransaction(database string, transaction int64) error
func (*MaintenanceManager) SetAccessModeReadOnly ¶
func (mm *MaintenanceManager) SetAccessModeReadOnly(database string) error
func (*MaintenanceManager) SetAccessModeReadWrite ¶
func (mm *MaintenanceManager) SetAccessModeReadWrite(database string) error
func (*MaintenanceManager) SetDialect ¶
func (mm *MaintenanceManager) SetDialect(database string, dialect int) error
func (*MaintenanceManager) SetPageBuffers ¶
func (mm *MaintenanceManager) SetPageBuffers(database string, pageCount int) error
func (*MaintenanceManager) SetPageFillNoReserve ¶
func (mm *MaintenanceManager) SetPageFillNoReserve(database string) error
func (*MaintenanceManager) SetPageFillReserve ¶
func (mm *MaintenanceManager) SetPageFillReserve(database string) error
func (*MaintenanceManager) SetSweepInterval ¶
func (mm *MaintenanceManager) SetSweepInterval(database string, transactions uint) error
func (*MaintenanceManager) SetWriteModeAsync ¶
func (mm *MaintenanceManager) SetWriteModeAsync(database string) error
func (*MaintenanceManager) SetWriteModeSync ¶
func (mm *MaintenanceManager) SetWriteModeSync(database string) error
func (*MaintenanceManager) Shutdown ¶
func (mm *MaintenanceManager) Shutdown(database string, shutdownMode ShutdownMode, timeout uint) error
func (*MaintenanceManager) ShutdownEx ¶
func (mm *MaintenanceManager) ShutdownEx(database string, operationMode OperationMode, shutdownModeEx ShutdownModeEx, timeout uint) error
func (*MaintenanceManager) Sweep ¶
func (mm *MaintenanceManager) Sweep(database string) error
func (*MaintenanceManager) Validate ¶
func (mm *MaintenanceManager) Validate(database string, options int) error
type NBackupManager ¶
type NBackupManager struct {
// contains filtered or unexported fields
}
func NewNBackupManager ¶
func NewNBackupManager(addr string, user string, password string, options ServiceManagerOptions) (*NBackupManager, error)
func (*NBackupManager) Backup ¶
func (bm *NBackupManager) Backup(database string, backup string, options NBackupOptions, verbose chan string) error
func (*NBackupManager) Fixup ¶
func (bm *NBackupManager) Fixup(database string, options NBackupOptions, verbose chan string) error
func (*NBackupManager) Restore ¶
func (bm *NBackupManager) Restore(backups []string, database string, options NBackupOptions, verbose chan string) error
type NBackupOption ¶
type NBackupOption func(*NBackupOptions)
func WithDBTriggers ¶
func WithDBTriggers() NBackupOption
func WithGuid ¶
func WithGuid(guid string) NBackupOption
func WithInPlaceRestore ¶
func WithInPlaceRestore() NBackupOption
func WithLevel ¶
func WithLevel(level int) NBackupOption
func WithPlaceRestore ¶
func WithPlaceRestore() NBackupOption
func WithPreserveSequence ¶
func WithPreserveSequence() NBackupOption
func WithoutDBTriggers ¶
func WithoutDBTriggers() NBackupOption
func WithoutPreserveSequence ¶
func WithoutPreserveSequence() NBackupOption
type NBackupOptions ¶
type NBackupOptions struct {
Level int32
Guid string
NoDBTriggers bool
InPlaceRestore bool
PreserveSequence bool
}
func GetDefaultNBackupOptions ¶
func GetDefaultNBackupOptions() NBackupOptions
func NewNBackupOptions ¶
func NewNBackupOptions(opts ...NBackupOption) NBackupOptions
func (NBackupOptions) GetOptionsMask ¶
func (o NBackupOptions) GetOptionsMask() int32
type OperationMode ¶
type OperationMode byte
const ( OperationModeNormal OperationMode = isc_spb_prp_sm_normal OperationModeMulti OperationMode = isc_spb_prp_sm_multi OperationModeSingle OperationMode = isc_spb_prp_sm_single OperationModeFull OperationMode = isc_spb_prp_sm_full )
type RestoreOption ¶
type RestoreOption func(*RestoreOptions)
func WithCacheBuffers ¶
func WithCacheBuffers(cacheBuffers int32) RestoreOption
func WithCommitAfterEachTable ¶
func WithCommitAfterEachTable() RestoreOption
func WithDeactivateIndexes ¶
func WithDeactivateIndexes() RestoreOption
func WithEnforceConstraints ¶
func WithEnforceConstraints() RestoreOption
func WithPageSize ¶
func WithPageSize(pageSize int32) RestoreOption
func WithReplace ¶
func WithReplace() RestoreOption
func WithRestoreParallelWorkers ¶
func WithRestoreParallelWorkers(parallelWorkers int32) RestoreOption
func WithRestoreShadows ¶
func WithRestoreShadows() RestoreOption
func WithUseAllPageSpace ¶
func WithUseAllPageSpace() RestoreOption
func WithoutCommitAfterEachTable ¶
func WithoutCommitAfterEachTable() RestoreOption
func WithoutEnforceConstraints ¶
func WithoutEnforceConstraints() RestoreOption
func WithoutReplace ¶
func WithoutReplace() RestoreOption
func WithoutRestoreParallelWorkers ¶
func WithoutRestoreParallelWorkers() RestoreOption
func WithoutRestoreShadows ¶
func WithoutRestoreShadows() RestoreOption
func WithoutUseAllPageSpace ¶
func WithoutUseAllPageSpace() RestoreOption
type RestoreOptions ¶
type RestoreOptions struct {
Replace bool
DeactivateIndexes bool
RestoreShadows bool
EnforceConstraints bool
CommitAfterEachTable bool
UseAllPageSpace bool
PageSize int32
CacheBuffers int32
ParallelWorkers int32
}
func GetDefaultRestoreOptions ¶
func GetDefaultRestoreOptions() RestoreOptions
func NewRestoreOptions ¶
func NewRestoreOptions(opts ...RestoreOption) RestoreOptions
type ServiceManager ¶
type ServiceManager struct {
// contains filtered or unexported fields
}
func NewServiceManager ¶
func NewServiceManager(addr string, user string, password string, options ServiceManagerOptions) (*ServiceManager, error)
func (*ServiceManager) Close ¶
func (svc *ServiceManager) Close() (err error)
func (*ServiceManager) GetArchitecture ¶
func (svc *ServiceManager) GetArchitecture() (string, error)
func (*ServiceManager) GetDbStats ¶
func (svc *ServiceManager) GetDbStats(database string, options StatisticsOptions, result chan string) error
func (*ServiceManager) GetDbStatsString ¶
func (svc *ServiceManager) GetDbStatsString(database string, options StatisticsOptions) (string, error)
func (*ServiceManager) GetFbLog ¶
func (svc *ServiceManager) GetFbLog(result chan string) error
func (*ServiceManager) GetFbLogString ¶
func (svc *ServiceManager) GetFbLogString() (string, error)
func (*ServiceManager) GetHomeDir ¶
func (svc *ServiceManager) GetHomeDir() (string, error)
func (*ServiceManager) GetLockFileDir ¶
func (svc *ServiceManager) GetLockFileDir() (string, error)
func (*ServiceManager) GetMsgFileDir ¶
func (svc *ServiceManager) GetMsgFileDir() (string, error)
func (*ServiceManager) GetSecurityDatabasePath ¶
func (svc *ServiceManager) GetSecurityDatabasePath() (string, error)
func (*ServiceManager) GetServerVersion ¶
func (svc *ServiceManager) GetServerVersion() (FirebirdVersion, error)
func (*ServiceManager) GetServerVersionString ¶
func (svc *ServiceManager) GetServerVersionString() (string, error)
func (*ServiceManager) GetServiceInfo ¶
func (svc *ServiceManager) GetServiceInfo(spb []byte, srb []byte, bufferLength int32) ([]byte, error)
func (*ServiceManager) GetServiceInfoInt ¶
func (svc *ServiceManager) GetServiceInfoInt(item byte) (int16, error)
func (*ServiceManager) GetServiceInfoString ¶
func (svc *ServiceManager) GetServiceInfoString(item byte) (string, error)
func (*ServiceManager) GetString ¶
func (svc *ServiceManager) GetString() (result string, end bool, err error)
func (*ServiceManager) GetSvrDbInfo ¶
func (svc *ServiceManager) GetSvrDbInfo() (*SrvDbInfo, error)
func (*ServiceManager) IsRunning ¶
func (svc *ServiceManager) IsRunning() (bool, error)
func (*ServiceManager) ServiceAttach ¶
func (svc *ServiceManager) ServiceAttach(spb []byte, verbose chan string) error
func (*ServiceManager) ServiceAttachBuffer ¶
func (svc *ServiceManager) ServiceAttachBuffer(spb []byte, verbose chan []byte) error
func (*ServiceManager) ServiceStart ¶
func (svc *ServiceManager) ServiceStart(spb []byte) error
func (*ServiceManager) Wait ¶
func (svc *ServiceManager) Wait() error
func (*ServiceManager) WaitBuffer ¶
func (svc *ServiceManager) WaitBuffer(stream chan []byte) error
func (*ServiceManager) WaitString ¶
func (svc *ServiceManager) WaitString() (string, error)
func (*ServiceManager) WaitStrings ¶
func (svc *ServiceManager) WaitStrings(result chan string) error
type ServiceManagerOption ¶
type ServiceManagerOption func(*ServiceManagerOptions)
func WithAuthPlugin ¶
func WithAuthPlugin(authPlugin string) ServiceManagerOption
func WithWireCrypt ¶
func WithWireCrypt() ServiceManagerOption
func WithoutWireCrypt ¶
func WithoutWireCrypt() ServiceManagerOption
type ServiceManagerOptions ¶
func GetDefaultServiceManagerOptions ¶
func GetDefaultServiceManagerOptions() ServiceManagerOptions
func NewServiceManagerOptions ¶
func NewServiceManagerOptions(opts ...ServiceManagerOption) ServiceManagerOptions
func (ServiceManagerOptions) WithAuthPlugin ¶
func (sm ServiceManagerOptions) WithAuthPlugin(authPlugin string) ServiceManagerOptions
func (ServiceManagerOptions) WithWireCrypt ¶
func (sm ServiceManagerOptions) WithWireCrypt() ServiceManagerOptions
func (ServiceManagerOptions) WithoutWireCrypt ¶
func (sm ServiceManagerOptions) WithoutWireCrypt() ServiceManagerOptions
type ShutdownMode ¶
type ShutdownMode byte
const ( //ShutdownModeForce Wait for N seconds then shutdown ShutdownModeForce ShutdownMode = isc_spb_prp_shutdown_db //ShutdownModeDenyNewAttachments Disable new attachments for N seconds then shutdown ShutdownModeDenyNewAttachments ShutdownMode = isc_spb_prp_deny_new_attachments //ShutdownModeDenyNewTransactions Disable new transactions for N seconds then shutdown ShutdownModeDenyNewTransactions ShutdownMode = isc_spb_prp_deny_new_transactions )
type ShutdownModeEx ¶
type ShutdownModeEx byte
const ( //ShutdownModeExForce Wait for N seconds then shutdown ShutdownModeExForce ShutdownModeEx = isc_spb_prp_force_shutdown //ShutdownModeExDenyNewAttachments Disable new attachments for N seconds then shutdown ShutdownModeExDenyNewAttachments ShutdownModeEx = isc_spb_prp_attachments_shutdown //ShutdownModeExDenyNewTransactions Disable new transactions for N seconds then shutdown ShutdownModeExDenyNewTransactions ShutdownModeEx = isc_spb_prp_transactions_shutdown )
type SrvDbInfo ¶
type StatisticsOption ¶
type StatisticsOption func(*StatisticsOptions)
func WithOnlyHeaderPages ¶
func WithOnlyHeaderPages() StatisticsOption
func WithRecordVersions ¶
func WithRecordVersions() StatisticsOption
func WithSystemRelationsAndIndexes ¶
func WithSystemRelationsAndIndexes() StatisticsOption
func WithTables ¶
func WithTables(tables []string) StatisticsOption
func WithUserDataPages ¶
func WithUserDataPages() StatisticsOption
func WithUserIndexPages ¶
func WithUserIndexPages() StatisticsOption
func WithoutIndexPages ¶
func WithoutIndexPages() StatisticsOption
func WithoutOnlyHeaderPages ¶
func WithoutOnlyHeaderPages() StatisticsOption
func WithoutRecordVersions ¶
func WithoutRecordVersions() StatisticsOption
func WithoutSystemRelationsAndIndexes ¶
func WithoutSystemRelationsAndIndexes() StatisticsOption
func WithoutUserDataPages ¶
func WithoutUserDataPages() StatisticsOption
type StatisticsOptions ¶
type StatisticsOptions struct {
UserDataPages bool
UserIndexPages bool
OnlyHeaderPages bool
SystemRelationsAndIndexes bool
RecordVersions bool
Tables []string
}
func GetDefaultStatisticsOptions ¶
func GetDefaultStatisticsOptions() StatisticsOptions
func NewStatisticsOptions ¶
func NewStatisticsOptions(opts ...StatisticsOption) StatisticsOptions
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
func (*Subscription) Close ¶
func (s *Subscription) Close() error
func (*Subscription) IsClose ¶
func (s *Subscription) IsClose() bool
func (*Subscription) NotifyClose ¶
func (s *Subscription) NotifyClose(receiver chan error)
func (*Subscription) Unsubscribe ¶
func (s *Subscription) Unsubscribe() error
type TraceManager ¶
type TraceManager struct {
// contains filtered or unexported fields
}
func NewTraceManager ¶
func NewTraceManager(addr string, user string, password string, options ServiceManagerOptions) (*TraceManager, error)
func (*TraceManager) List ¶
func (t *TraceManager) List() (string, error)
func (*TraceManager) Start ¶
func (t *TraceManager) Start(config string) (*TraceSession, error)
func (*TraceManager) StartWithName ¶
func (t *TraceManager) StartWithName(name string, config string) (*TraceSession, error)
type TraceSession ¶
type TraceSession struct {
// contains filtered or unexported fields
}
func (*TraceSession) Close ¶
func (ts *TraceSession) Close() (err error)
func (*TraceSession) Pause ¶
func (ts *TraceSession) Pause() (err error)
func (*TraceSession) Resume ¶
func (ts *TraceSession) Resume() (err error)
func (*TraceSession) Stop ¶
func (ts *TraceSession) Stop() (err error)
func (*TraceSession) Wait ¶
func (ts *TraceSession) Wait() (err error)
func (*TraceSession) WaitStrings ¶
func (ts *TraceSession) WaitStrings(result chan string) (err error)
type User ¶
type User struct {
Username *string
Password *string
FirstName *string
MiddleName *string
LastName *string
UserId int32
GroupId int32
Admin *bool
}
func NewUser ¶
func NewUser(opts ...UserOption) User
func (*User) GetSpb ¶
type UserManager ¶
type UserManager struct {
// contains filtered or unexported fields
}
func NewUserManager ¶
func NewUserManager(addr string, user string, password string, smo ServiceManagerOptions, umo UserManagerOptions) (*UserManager, error)
func (*UserManager) AddUser ¶
func (um *UserManager) AddUser(user User) error
func (*UserManager) Close ¶
func (um *UserManager) Close() error
func (*UserManager) DeleteUser ¶
func (um *UserManager) DeleteUser(user User) error
func (*UserManager) DropAdminRoleMapping ¶
func (um *UserManager) DropAdminRoleMapping() error
func (*UserManager) GetUsers ¶
func (um *UserManager) GetUsers() ([]User, error)
func (*UserManager) ModifyUser ¶
func (um *UserManager) ModifyUser(user User) error
func (*UserManager) SetAdminRoleMapping ¶
func (um *UserManager) SetAdminRoleMapping() error
type UserManagerOption ¶
type UserManagerOption func(*UserManagerOptions)
func WithSecurityDB ¶
func WithSecurityDB(securityDB string) UserManagerOption
type UserManagerOptions ¶
type UserManagerOptions struct {
SecurityDB string
}
func GetDefaultUserManagerOptions ¶
func GetDefaultUserManagerOptions() UserManagerOptions
func NewUserManagerOptions ¶
func NewUserManagerOptions(opts ...UserManagerOption) UserManagerOptions
type UserOption ¶
type UserOption func(*User)
func WithAdmin ¶
func WithAdmin() UserOption
func WithFirstName ¶
func WithFirstName(firstname string) UserOption
func WithGroupId ¶
func WithGroupId(groupId int32) UserOption
func WithLastName ¶
func WithLastName(lastname string) UserOption
func WithMiddleName ¶
func WithMiddleName(middlename string) UserOption
func WithPassword ¶
func WithPassword(password string) UserOption
func WithUserId ¶
func WithUserId(userId int32) UserOption
func WithUsername ¶
func WithUsername(username string) UserOption
func WithoutAdmin ¶
func WithoutAdmin() UserOption
type XPBReader ¶
type XPBReader struct {
// contains filtered or unexported fields
}
func NewXPBReader ¶
func (*XPBReader) End ¶
func (*XPBReader) Get ¶
func (*XPBReader) GetInt16 ¶
func (*XPBReader) GetInt32 ¶
func (*XPBReader) GetInt64 ¶
func (*XPBReader) GetString ¶
func (*XPBReader) Next ¶
func (*XPBReader) Reset ¶
func (pb *XPBReader) Reset()
func (*XPBReader) Skip ¶
type XPBWriter ¶
type XPBWriter struct {
// contains filtered or unexported fields
}
func NewXPBWriter ¶
func NewXPBWriter() *XPBWriter
func NewXPBWriterFromBytes ¶
func NewXPBWriterFromTag ¶
func (*XPBWriter) Bytes ¶
func (*XPBWriter) PutByte ¶
func (*XPBWriter) PutBytes ¶
func (*XPBWriter) PutInt16 ¶
func (*XPBWriter) PutInt32 ¶
func (*XPBWriter) PutInt64 ¶
func (*XPBWriter) PutString ¶
func (*XPBWriter) PutTag ¶
func (*XPBWriter) Reset ¶
Source Files ¶
backup_manager.go charset.go connection.go consts.go decfloat.go driver.go driver_go18.go dsn.go errmsgs.go errors.go event.go eventmanager.go firebird_version.go maintenance_manager.go nbackup_manager.go remoteEvent.go result.go rows.go service_manager.go srp.go statement.go subscriber.go timezone_resolve.go timezonemap.go trace_manager.go transaction.go user_manager.go utils.go wirechannel.go wireprotocol.go xpb.go xsqlvar.go
Directories ¶
| Path | Synopsis |
|---|---|
| _attic | |
| _attic/timezonemap | Generator for timezonemap.go. |
| _examples |
- Version
- v0.9.17
- Published
- Mar 26, 2026
- Platform
- js/wasm
- Imports
- 43 packages
- Last checked
- now –
Tools for package owners.