firebirdsql

package module
v0.9.15 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 42 Imported by: 87

README

firebirdsql (Go firebird sql driver)

Firebird RDBMS https://firebirdsql.org SQL driver for Go

Requirements

  • Firebird 2.5 or higher
  • Golang 1.20 or higher

Example

package main

import (
    "fmt"
    "database/sql"
    _ "github.com/nakagami/firebirdsql"
)

func main() {
    var n int
    conn, _ := sql.Open("firebirdsql", "user:password@servername/foo/bar.fdb")
    defer conn.Close()
    conn.QueryRow("SELECT Count(*) FROM rdb$relations").Scan(&n)
    fmt.Println("Relations count=", n)

}

See also driver_test.go

   package main

      import (
       "fmt"
       "github.com/nakagami/firebirdsql"
   )

   func main() {
       dsn := "user:password@servername/foo/bar.fdb"
       events := []string{"my_event", "order_created"}
       fbEvent, _ := firebirdsql.NewFBEvent(dsn)
       defer fbEvent.Close()
       sbr, _ := fbEvent.Subscribe(events, func(event firebirdsql.Event) { //or use SubscribeChan
           fmt.Printf("event: %s, count: %d, id: %d, remote id:%d \n", event.Name, event.Count, event.ID, event.RemoteID)
       })
       defer sbr.Unsubscribe()
       go func() {
               fbEvent.PostEvent(events[0])
               fbEvent.PostEvent(events[1])
       }()
       <- make(chan struct{}) //wait
   }

See also _example

Connection string

user:password@servername[:port_number]/database_name_or_file[?params1=value1[&param2=value2]...]
General
  • user: login user
  • password: login password
  • servername: Firebird server's host name or IP address.
  • port_number: Port number. default value is 3050.
  • database_name_or_file: Database path (or alias name).
Optional

param1, param2... are

Name Description Default Note
auth_plugin_name Authentication plugin name. Srp256 Srp256/Srp/Legacy_Auth are available.
column_name_to_lower Force column name to lower false For "github.com/jmoiron/sqlx"
role Role name
timezone Time Zone name For Firebird 4.0+
wire_crypt Enable wire data encryption or not. true For Firebird 3.0+
charset Firebird Charecter Set

GORM for Firebird

See https://github.com/flylink888/gorm-firebird

Documentation

Overview

Package firebird provides database/sql driver for Firebird RDBMS.

Index

Constants

View Source
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
)
View Source
const (
	ISOLATION_LEVEL_READ_COMMITED_LEGACY = iota
	ISOLATION_LEVEL_READ_COMMITED
	ISOLATION_LEVEL_REPEATABLE_READ
	ISOLATION_LEVEL_SERIALIZABLE
	ISOLATION_LEVEL_READ_COMMITED_RO
)
View Source
const (
	SRP_KEY_SIZE      = 128
	SRP_SALT_SIZE     = 32
	DEBUG_PRIVATE_KEY = "60975527035CF2AD1989806F0407210BC81EDC04E2762A56AFD529DDDA2D4393"
	DEBUG_SRP         = false
)
View Source
const (
	SessionStopped = iota
	SessionRunning
	SessionPaused
)
View Source
const (
	PLUGIN_LIST       = "Srp256,Srp,Legacy_Auth"
	BUFFER_LEN        = 1024
	MAX_CHAR_LENGTH   = 32767
	BLOB_SEGMENT_SIZE = 32000
)
View Source
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
)
View Source
const (
	EPB_version1 = 1
)

Event

Variables

View Source
var (
	ErrAlreadySubscribe = errors.New("already subscribe")
	ErrFbEventClosed    = errors.New("fbevent already closed")
)

Errors

View Source
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")
)
View Source
var ErrDsnUserUnknown = errors.New("User unknown")
View Source
var ErrOpSqlResponse = errors.New("Error op_sql_response")
View Source
var FirebirdVersionPattern = regexp.MustCompile(`((\w{2})-(\w)(\d+)\.(\d+)\.(\d+)\.(\d+)(?:-\S+)?) (.+)`)

Functions

func GetServiceInfoSPBPreamble added in v0.9.12

func GetServiceInfoSPBPreamble() []byte

func NewErrOpResonse

func NewErrOpResonse(opRCode int32) error

Error interface implementation

Types

type BackupManager added in v0.9.12

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

func NewBackupManager added in v0.9.12

func NewBackupManager(addr string, user string, password string, options ServiceManagerOptions) (*BackupManager, error)

func (*BackupManager) Backup added in v0.9.12

func (bm *BackupManager) Backup(database string, backup string, options BackupOptions, verbose chan string) error

func (*BackupManager) Restore added in v0.9.12

func (bm *BackupManager) Restore(backup string, database string, options RestoreOptions, verbose chan string) error

type BackupOption added in v0.9.12

type BackupOption func(*BackupOptions)

func WithConvertExternalTablesToInternalTables added in v0.9.12

func WithConvertExternalTablesToInternalTables() BackupOption

func WithExpand added in v0.9.12

func WithExpand() BackupOption

func WithGarbageCollect added in v0.9.12

func WithGarbageCollect() BackupOption

func WithIgnoreChecksums added in v0.9.12

func WithIgnoreChecksums() BackupOption

func WithIgnoreLimboTransactions added in v0.9.12

func WithIgnoreLimboTransactions() BackupOption

func WithMetadataOnly added in v0.9.12

func WithMetadataOnly() BackupOption

func WithTransportable added in v0.9.12

func WithTransportable() BackupOption

func WithoutConvertExternalTablesToInternalTables added in v0.9.12

func WithoutConvertExternalTablesToInternalTables() BackupOption

func WithoutExpand added in v0.9.12

func WithoutExpand() BackupOption

func WithoutGarbageCollect added in v0.9.12

func WithoutGarbageCollect() BackupOption

func WithoutIgnoreChecksums added in v0.9.12

func WithoutIgnoreChecksums() BackupOption

func WithoutIgnoreLimboTransactions added in v0.9.12

func WithoutIgnoreLimboTransactions() BackupOption

func WithoutMetadataOnly added in v0.9.12

func WithoutMetadataOnly() BackupOption

func WithoutTransportable added in v0.9.12

func WithoutTransportable() BackupOption

type BackupOptions added in v0.9.12

type BackupOptions struct {
	IgnoreChecksums                       bool
	IgnoreLimboTransactions               bool
	MetadataOnly                          bool
	GarbageCollect                        bool
	Transportable                         bool
	ConvertExternalTablesToInternalTables bool
	Expand                                bool
}

func GetDefaultBackupOptions added in v0.9.12

func GetDefaultBackupOptions() BackupOptions

func NewBackupOptions added in v0.9.12

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

type Event struct {
	Name     string
	Count    int
	ID       int32
	RemoteID int32
}

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 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

func NewFBEvent(dsns string) (*FbEvent, error)

NewFBEvent returns FbEvent for event subscription

func (*FbEvent) Close

func (e *FbEvent) Close() error

Close closes FbEvent and all subscribers

func (*FbEvent) Count

func (e *FbEvent) Count() int

Count returns the number of subscribers

func (*FbEvent) IsClosed

func (e *FbEvent) IsClosed() bool

IsClosed returns a close flag

func (*FbEvent) PostEvent

func (e *FbEvent) PostEvent(name string) error

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 added in v0.9.12

type FirebirdVersion struct {
	Platform    string
	Type        string
	Full        string
	Major       int
	Minor       int
	Patch       int
	BuildNumber int
	Raw         string
}

func ParseFirebirdVersion added in v0.9.12

func ParseFirebirdVersion(rawVersionString string) FirebirdVersion

func (FirebirdVersion) EqualOrGreater added in v0.9.12

func (v FirebirdVersion) EqualOrGreater(major int, minor int) bool

func (FirebirdVersion) EqualOrGreaterPatch added in v0.9.12

func (v FirebirdVersion) EqualOrGreaterPatch(major int, minor int, patch int) bool

type MaintenanceManager added in v0.9.12

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

func NewMaintenanceManager added in v0.9.12

func NewMaintenanceManager(addr string, user string, password string, options ServiceManagerOptions) (*MaintenanceManager, error)

func (*MaintenanceManager) ActivateShadow added in v0.9.12

func (mm *MaintenanceManager) ActivateShadow(shadow string) error

func (*MaintenanceManager) CommitTransaction added in v0.9.12

func (mm *MaintenanceManager) CommitTransaction(database string, transaction int64) error

func (*MaintenanceManager) GetLimboTransactions added in v0.9.12

func (mm *MaintenanceManager) GetLimboTransactions(database string) ([]int64, error)

func (*MaintenanceManager) KillShadow added in v0.9.12

func (mm *MaintenanceManager) KillShadow(database string) error

func (*MaintenanceManager) Mend added in v0.9.12

func (mm *MaintenanceManager) Mend(database string) error

func (*MaintenanceManager) NoLinger added in v0.9.12

func (mm *MaintenanceManager) NoLinger(database string) error

func (*MaintenanceManager) Online added in v0.9.12

func (mm *MaintenanceManager) Online(database string) error

func (*MaintenanceManager) OnlineEx added in v0.9.12

func (mm *MaintenanceManager) OnlineEx(database string, operationMode OperationMode) error

func (*MaintenanceManager) RollbackTransaction added in v0.9.12

func (mm *MaintenanceManager) RollbackTransaction(database string, transaction int64) error

func (*MaintenanceManager) SetAccessModeReadOnly added in v0.9.12

func (mm *MaintenanceManager) SetAccessModeReadOnly(database string) error

func (*MaintenanceManager) SetAccessModeReadWrite added in v0.9.12

func (mm *MaintenanceManager) SetAccessModeReadWrite(database string) error

func (*MaintenanceManager) SetDialect added in v0.9.12

func (mm *MaintenanceManager) SetDialect(database string, dialect int) error

func (*MaintenanceManager) SetPageBuffers added in v0.9.12

func (mm *MaintenanceManager) SetPageBuffers(database string, pageCount int) error

func (*MaintenanceManager) SetPageFillNoReserve added in v0.9.12

func (mm *MaintenanceManager) SetPageFillNoReserve(database string) error

func (*MaintenanceManager) SetPageFillReserve added in v0.9.12

func (mm *MaintenanceManager) SetPageFillReserve(database string) error

func (*MaintenanceManager) SetSweepInterval added in v0.9.12

func (mm *MaintenanceManager) SetSweepInterval(database string, transactions uint) error

func (*MaintenanceManager) SetWriteModeAsync added in v0.9.12

func (mm *MaintenanceManager) SetWriteModeAsync(database string) error

func (*MaintenanceManager) SetWriteModeSync added in v0.9.12

func (mm *MaintenanceManager) SetWriteModeSync(database string) error

func (*MaintenanceManager) Shutdown added in v0.9.12

func (mm *MaintenanceManager) Shutdown(database string, shutdownMode ShutdownMode, timeout uint) error

func (*MaintenanceManager) ShutdownEx added in v0.9.12

func (mm *MaintenanceManager) ShutdownEx(database string, operationMode OperationMode, shutdownModeEx ShutdownModeEx, timeout uint) error

func (*MaintenanceManager) Sweep added in v0.9.12

func (mm *MaintenanceManager) Sweep(database string) error

func (*MaintenanceManager) Validate added in v0.9.12

func (mm *MaintenanceManager) Validate(database string, options int) error

type NBackupManager added in v0.9.12

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

func NewNBackupManager added in v0.9.12

func NewNBackupManager(addr string, user string, password string, options ServiceManagerOptions) (*NBackupManager, error)

func (*NBackupManager) Backup added in v0.9.12

func (bm *NBackupManager) Backup(database string, backup string, options NBackupOptions, verbose chan string) error

func (*NBackupManager) Fixup added in v0.9.12

func (bm *NBackupManager) Fixup(database string, options NBackupOptions, verbose chan string) error

func (*NBackupManager) Restore added in v0.9.12

func (bm *NBackupManager) Restore(backups []string, database string, options NBackupOptions, verbose chan string) error

type NBackupOption added in v0.9.12

type NBackupOption func(*NBackupOptions)

func WithDBTriggers added in v0.9.12

func WithDBTriggers() NBackupOption

func WithGuid added in v0.9.12

func WithGuid(guid string) NBackupOption

func WithInPlaceRestore added in v0.9.12

func WithInPlaceRestore() NBackupOption

func WithLevel added in v0.9.12

func WithLevel(level int) NBackupOption

func WithPlaceRestore added in v0.9.12

func WithPlaceRestore() NBackupOption

func WithPreserveSequence added in v0.9.12

func WithPreserveSequence() NBackupOption

func WithoutDBTriggers added in v0.9.12

func WithoutDBTriggers() NBackupOption

func WithoutPreserveSequence added in v0.9.12

func WithoutPreserveSequence() NBackupOption

type NBackupOptions added in v0.9.12

type NBackupOptions struct {
	Level            int32
	Guid             string
	NoDBTriggers     bool
	InPlaceRestore   bool
	PreserveSequence bool
}

func GetDefaultNBackupOptions added in v0.9.12

func GetDefaultNBackupOptions() NBackupOptions

func NewNBackupOptions added in v0.9.12

func NewNBackupOptions(opts ...NBackupOption) NBackupOptions

func (NBackupOptions) GetOptionsMask added in v0.9.12

func (o NBackupOptions) GetOptionsMask() int32

type OperationMode added in v0.9.12

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 added in v0.9.12

type RestoreOption func(*RestoreOptions)

func WithCacheBuffers added in v0.9.12

func WithCacheBuffers(cacheBuffers int32) RestoreOption

func WithCommitAfterEachTable added in v0.9.12

func WithCommitAfterEachTable() RestoreOption

func WithDeactivateIndexes added in v0.9.12

func WithDeactivateIndexes() RestoreOption

func WithEnforceConstraints added in v0.9.12

func WithEnforceConstraints() RestoreOption

func WithPageSize added in v0.9.12

func WithPageSize(pageSize int32) RestoreOption

func WithReplace added in v0.9.12

func WithReplace() RestoreOption

func WithRestoreShadows added in v0.9.12

func WithRestoreShadows() RestoreOption

func WithUseAllPageSpace added in v0.9.12

func WithUseAllPageSpace() RestoreOption

func WithoutCommitAfterEachTable added in v0.9.12

func WithoutCommitAfterEachTable() RestoreOption

func WithoutEnforceConstraints added in v0.9.12

func WithoutEnforceConstraints() RestoreOption

func WithoutReplace added in v0.9.12

func WithoutReplace() RestoreOption

func WithoutRestoreShadows added in v0.9.12

func WithoutRestoreShadows() RestoreOption

func WithoutUseAllPageSpace added in v0.9.12

func WithoutUseAllPageSpace() RestoreOption

type RestoreOptions added in v0.9.12

type RestoreOptions struct {
	Replace              bool
	DeactivateIndexes    bool
	RestoreShadows       bool
	EnforceConstraints   bool
	CommitAfterEachTable bool
	UseAllPageSpace      bool
	PageSize             int32
	CacheBuffers         int32
}

func GetDefaultRestoreOptions added in v0.9.12

func GetDefaultRestoreOptions() RestoreOptions

func NewRestoreOptions added in v0.9.12

func NewRestoreOptions(opts ...RestoreOption) RestoreOptions

type ServiceManager added in v0.9.12

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

func NewServiceManager added in v0.9.12

func NewServiceManager(addr string, user string, password string, options ServiceManagerOptions) (*ServiceManager, error)

func (*ServiceManager) Close added in v0.9.12

func (svc *ServiceManager) Close() (err error)

func (*ServiceManager) GetArchitecture added in v0.9.12

func (svc *ServiceManager) GetArchitecture() (string, error)

func (*ServiceManager) GetDbStats added in v0.9.12

func (svc *ServiceManager) GetDbStats(database string, options StatisticsOptions, result chan string) error

func (*ServiceManager) GetDbStatsString added in v0.9.12

func (svc *ServiceManager) GetDbStatsString(database string, options StatisticsOptions) (string, error)

func (*ServiceManager) GetFbLog added in v0.9.12

func (svc *ServiceManager) GetFbLog(result chan string) error

func (*ServiceManager) GetFbLogString added in v0.9.12

func (svc *ServiceManager) GetFbLogString() (string, error)

func (*ServiceManager) GetHomeDir added in v0.9.12

func (svc *ServiceManager) GetHomeDir() (string, error)

func (*ServiceManager) GetLockFileDir added in v0.9.12

func (svc *ServiceManager) GetLockFileDir() (string, error)

func (*ServiceManager) GetMsgFileDir added in v0.9.12

func (svc *ServiceManager) GetMsgFileDir() (string, error)

func (*ServiceManager) GetSecurityDatabasePath added in v0.9.12

func (svc *ServiceManager) GetSecurityDatabasePath() (string, error)

func (*ServiceManager) GetServerVersion added in v0.9.12

func (svc *ServiceManager) GetServerVersion() (FirebirdVersion, error)

func (*ServiceManager) GetServerVersionString added in v0.9.12

func (svc *ServiceManager) GetServerVersionString() (string, error)

func (*ServiceManager) GetServiceInfo added in v0.9.12

func (svc *ServiceManager) GetServiceInfo(spb []byte, srb []byte, bufferLength int32) ([]byte, error)

func (*ServiceManager) GetServiceInfoInt added in v0.9.12

func (svc *ServiceManager) GetServiceInfoInt(item byte) (int16, error)

func (*ServiceManager) GetServiceInfoString added in v0.9.12

func (svc *ServiceManager) GetServiceInfoString(item byte) (string, error)

func (*ServiceManager) GetString added in v0.9.12

func (svc *ServiceManager) GetString() (result string, end bool, err error)

func (*ServiceManager) GetSvrDbInfo added in v0.9.12

func (svc *ServiceManager) GetSvrDbInfo() (*SrvDbInfo, error)

func (*ServiceManager) IsRunning added in v0.9.12

func (svc *ServiceManager) IsRunning() (bool, error)

func (*ServiceManager) ServiceAttach added in v0.9.12

func (svc *ServiceManager) ServiceAttach(spb []byte, verbose chan string) error

func (*ServiceManager) ServiceAttachBuffer added in v0.9.12

func (svc *ServiceManager) ServiceAttachBuffer(spb []byte, verbose chan []byte) error

func (*ServiceManager) ServiceStart added in v0.9.12

func (svc *ServiceManager) ServiceStart(spb []byte) error

func (*ServiceManager) Wait added in v0.9.12

func (svc *ServiceManager) Wait() error

func (*ServiceManager) WaitBuffer added in v0.9.12

func (svc *ServiceManager) WaitBuffer(stream chan []byte) error

func (*ServiceManager) WaitString added in v0.9.12

func (svc *ServiceManager) WaitString() (string, error)

func (*ServiceManager) WaitStrings added in v0.9.12

func (svc *ServiceManager) WaitStrings(result chan string) error

type ServiceManagerOption added in v0.9.12

type ServiceManagerOption func(*ServiceManagerOptions)

func WithAuthPlugin added in v0.9.12

func WithAuthPlugin(authPlugin string) ServiceManagerOption

func WithWireCrypt added in v0.9.12

func WithWireCrypt() ServiceManagerOption

func WithoutWireCrypt added in v0.9.12

func WithoutWireCrypt() ServiceManagerOption

type ServiceManagerOptions added in v0.9.12

type ServiceManagerOptions struct {
	WireCrypt  bool
	AuthPlugin string
}

func GetDefaultServiceManagerOptions added in v0.9.12

func GetDefaultServiceManagerOptions() ServiceManagerOptions

func NewServiceManagerOptions added in v0.9.12

func NewServiceManagerOptions(opts ...ServiceManagerOption) ServiceManagerOptions

func (ServiceManagerOptions) WithAuthPlugin added in v0.9.12

func (sm ServiceManagerOptions) WithAuthPlugin(authPlugin string) ServiceManagerOptions

func (ServiceManagerOptions) WithWireCrypt added in v0.9.12

func (sm ServiceManagerOptions) WithWireCrypt() ServiceManagerOptions

func (ServiceManagerOptions) WithoutWireCrypt added in v0.9.12

func (sm ServiceManagerOptions) WithoutWireCrypt() ServiceManagerOptions

type ShutdownMode added in v0.9.12

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 added in v0.9.12

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 added in v0.9.12

type SrvDbInfo struct {
	AttachmentsCount int
	DatabaseCount    int
	Databases        []string
}

type StatisticsOption added in v0.9.12

type StatisticsOption func(*StatisticsOptions)

func WithOnlyHeaderPages added in v0.9.12

func WithOnlyHeaderPages() StatisticsOption

func WithRecordVersions added in v0.9.12

func WithRecordVersions() StatisticsOption

func WithSystemRelationsAndIndexes added in v0.9.12

func WithSystemRelationsAndIndexes() StatisticsOption

func WithTables added in v0.9.12

func WithTables(tables []string) StatisticsOption

func WithUserDataPages added in v0.9.12

func WithUserDataPages() StatisticsOption

func WithUserIndexPages added in v0.9.12

func WithUserIndexPages() StatisticsOption

func WithoutIndexPages added in v0.9.12

func WithoutIndexPages() StatisticsOption

func WithoutOnlyHeaderPages added in v0.9.12

func WithoutOnlyHeaderPages() StatisticsOption

func WithoutRecordVersions added in v0.9.12

func WithoutRecordVersions() StatisticsOption

func WithoutSystemRelationsAndIndexes added in v0.9.12

func WithoutSystemRelationsAndIndexes() StatisticsOption

func WithoutUserDataPages added in v0.9.12

func WithoutUserDataPages() StatisticsOption

type StatisticsOptions added in v0.9.12

type StatisticsOptions struct {
	UserDataPages             bool
	UserIndexPages            bool
	OnlyHeaderPages           bool
	SystemRelationsAndIndexes bool
	RecordVersions            bool
	Tables                    []string
}

func GetDefaultStatisticsOptions added in v0.9.12

func GetDefaultStatisticsOptions() StatisticsOptions

func NewStatisticsOptions added in v0.9.12

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 added in v0.9.12

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

func NewTraceManager added in v0.9.12

func NewTraceManager(addr string, user string, password string, options ServiceManagerOptions) (*TraceManager, error)

func (*TraceManager) List added in v0.9.12

func (t *TraceManager) List() (string, error)

func (*TraceManager) Start added in v0.9.12

func (t *TraceManager) Start(config string) (*TraceSession, error)

func (*TraceManager) StartWithName added in v0.9.12

func (t *TraceManager) StartWithName(name string, config string) (*TraceSession, error)

type TraceSession added in v0.9.12

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

func (*TraceSession) Close added in v0.9.12

func (ts *TraceSession) Close() (err error)

func (*TraceSession) Pause added in v0.9.12

func (ts *TraceSession) Pause() (err error)

func (*TraceSession) Resume added in v0.9.12

func (ts *TraceSession) Resume() (err error)

func (*TraceSession) Stop added in v0.9.12

func (ts *TraceSession) Stop() (err error)

func (*TraceSession) Wait added in v0.9.12

func (ts *TraceSession) Wait() (err error)

func (*TraceSession) WaitStrings added in v0.9.12

func (ts *TraceSession) WaitStrings(result chan string) (err error)

type User added in v0.9.12

type User struct {
	Username   *string
	Password   *string
	FirstName  *string
	MiddleName *string
	LastName   *string
	UserId     int32
	GroupId    int32
	Admin      *bool
}

func NewUser added in v0.9.12

func NewUser(opts ...UserOption) User

func (*User) GetSpb added in v0.9.12

func (u *User) GetSpb() []byte

type UserManager added in v0.9.12

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

func NewUserManager added in v0.9.12

func NewUserManager(addr string, user string, password string, smo ServiceManagerOptions, umo UserManagerOptions) (*UserManager, error)

func (*UserManager) AddUser added in v0.9.12

func (um *UserManager) AddUser(user User) error

func (*UserManager) Close added in v0.9.12

func (um *UserManager) Close() error

func (*UserManager) DeleteUser added in v0.9.12

func (um *UserManager) DeleteUser(user User) error

func (*UserManager) DropAdminRoleMapping added in v0.9.12

func (um *UserManager) DropAdminRoleMapping() error

func (*UserManager) GetUsers added in v0.9.12

func (um *UserManager) GetUsers() ([]User, error)

func (*UserManager) ModifyUser added in v0.9.12

func (um *UserManager) ModifyUser(user User) error

func (*UserManager) SetAdminRoleMapping added in v0.9.12

func (um *UserManager) SetAdminRoleMapping() error

type UserManagerOption added in v0.9.12

type UserManagerOption func(*UserManagerOptions)

func WithSecurityDB added in v0.9.12

func WithSecurityDB(securityDB string) UserManagerOption

type UserManagerOptions added in v0.9.12

type UserManagerOptions struct {
	SecurityDB string
}

func GetDefaultUserManagerOptions added in v0.9.12

func GetDefaultUserManagerOptions() UserManagerOptions

func NewUserManagerOptions added in v0.9.12

func NewUserManagerOptions(opts ...UserManagerOption) UserManagerOptions

type UserOption added in v0.9.12

type UserOption func(*User)

func WithAdmin added in v0.9.12

func WithAdmin() UserOption

func WithFirstName added in v0.9.12

func WithFirstName(firstname string) UserOption

func WithGroupId added in v0.9.12

func WithGroupId(groupId int32) UserOption

func WithLastName added in v0.9.12

func WithLastName(lastname string) UserOption

func WithMiddleName added in v0.9.12

func WithMiddleName(middlename string) UserOption

func WithPassword added in v0.9.12

func WithPassword(password string) UserOption

func WithUserId added in v0.9.12

func WithUserId(userId int32) UserOption

func WithUsername added in v0.9.12

func WithUsername(username string) UserOption

func WithoutAdmin added in v0.9.12

func WithoutAdmin() UserOption

type XPBReader added in v0.9.12

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

func NewXPBReader added in v0.9.12

func NewXPBReader(buf []byte) *XPBReader

func (*XPBReader) End added in v0.9.12

func (pb *XPBReader) End() bool

func (*XPBReader) Get added in v0.9.12

func (pb *XPBReader) Get() byte

func (*XPBReader) GetInt16 added in v0.9.12

func (pb *XPBReader) GetInt16() int16

func (*XPBReader) GetInt32 added in v0.9.12

func (pb *XPBReader) GetInt32() int32

func (*XPBReader) GetInt64 added in v0.9.12

func (pb *XPBReader) GetInt64() int64

func (*XPBReader) GetString added in v0.9.12

func (pb *XPBReader) GetString() string

func (*XPBReader) Next added in v0.9.12

func (pb *XPBReader) Next() (have bool, value byte)

func (*XPBReader) Reset added in v0.9.12

func (pb *XPBReader) Reset()

func (*XPBReader) Skip added in v0.9.12

func (pb *XPBReader) Skip(count int)

type XPBWriter added in v0.9.12

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

func NewXPBWriter added in v0.9.12

func NewXPBWriter() *XPBWriter

func NewXPBWriterFromBytes added in v0.9.12

func NewXPBWriterFromBytes(bytes []byte) *XPBWriter

func NewXPBWriterFromTag added in v0.9.12

func NewXPBWriterFromTag(tag byte) *XPBWriter

func (*XPBWriter) Bytes added in v0.9.12

func (pb *XPBWriter) Bytes() []byte

func (*XPBWriter) PutByte added in v0.9.12

func (pb *XPBWriter) PutByte(tag byte, val byte) *XPBWriter

func (*XPBWriter) PutBytes added in v0.9.12

func (pb *XPBWriter) PutBytes(bytes []byte) *XPBWriter

func (*XPBWriter) PutInt16 added in v0.9.12

func (pb *XPBWriter) PutInt16(tag byte, val int16) *XPBWriter

func (*XPBWriter) PutInt32 added in v0.9.12

func (pb *XPBWriter) PutInt32(tag byte, val int32) *XPBWriter

func (*XPBWriter) PutInt64 added in v0.9.12

func (pb *XPBWriter) PutInt64(tag byte, val int64) *XPBWriter

func (*XPBWriter) PutString added in v0.9.12

func (pb *XPBWriter) PutString(tag byte, val string) *XPBWriter

func (*XPBWriter) PutTag added in v0.9.12

func (pb *XPBWriter) PutTag(tag byte) *XPBWriter

func (*XPBWriter) Reset added in v0.9.12

func (pb *XPBWriter) Reset() *XPBWriter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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