sqlserver

package
v0.0.0-...-86c6960 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const AllDatabases = "ALL"
View Source
const BlobNamePrefix = "blob_"
View Source
const ExternalBackupFilenameSeparator = ","
View Source
const LogNamePrefix = "wal_"
View Source
const MaxBlocksPerBlob = 25000 // 50000 actually, but we need some safety margin
View Source
const MaxTransferSize = 4 * 1024 * 1024
View Source
const TimeSQLServerFormat = "Jan 02, 2006 03:04:05 PM"

Variables

View Source
var SystemDbnames = []string{
	"master",
	"msdb",
	"model",
}

Functions

func GetDBRestoreLSN

func GetDBRestoreLSN(db *sql.DB, databaseName string) (string, error)

func GetDefaultDataLogDirs

func GetDefaultDataLogDirs(db *sql.DB) (string, string, error)

func HandleBackupExport

func HandleBackupExport(externalConfig string, exportPrefixes map[string]string)

func HandleBackupImport

func HandleBackupImport(externalConfig string, importDatabases map[string]string)

func HandleBackupPush

func HandleBackupPush(dbnames []string, updateLatest bool)

func HandleBackupRestore

func HandleBackupRestore(backupName string, dbnames []string, fromnames []string, noRecovery bool)

func HandleDatabaseList

func HandleDatabaseList(backupName string)

func HandleLogPush

func HandleLogPush(dbnames []string, norecovery bool)

func HandleLogRestore

func HandleLogRestore(backupName string, untilTS string, dbnames []string, fromnames []string, noRecovery bool)

func IsLogAlreadyApplied

func IsLogAlreadyApplied(db *sql.DB, databaseName string, logBackupFileProperties *BackupProperties) (bool, error)

func RunProxy

func RunProxy(folder storage.Folder)

Types

type BackupProperties

type BackupProperties struct {
	BackupType        int
	DatabaseName      string
	FirstLSN          string
	LastLSN           string
	CheckpointLSN     string
	DatabaseBackupLSN string
	BackupStartDate   time.Time
	BackupFinishDate  time.Time
	HasBulkLoggedData bool
	IsSnapshot        bool
	IsReadOnly        bool
	IsSingleUser      bool
	BackupURL         string
	BackupFile        string
}

func GetBackupProperties

func GetBackupProperties(db *sql.DB,
	folder storage.Folder,
	logBackup bool,
	backupName string,
	databaseName string,
) ([]*BackupProperties, error)

type DatabaseFile

type DatabaseFile struct {
	LogicalName  string
	PhysicalName string
	Type         string
	FileID       int
}

type LockWrapper

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

func RunOrReuseProxy

func RunOrReuseProxy(ctx context.Context, cancel context.CancelFunc, folder storage.Folder) (*LockWrapper, error)

func (LockWrapper) Close

func (lw LockWrapper) Close()

type SentinelDto

type SentinelDto struct {
	Server         string
	Databases      []string
	StartLocalTime time.Time `json:"StartLocalTime,omitempty"`
	StopLocalTime  time.Time `json:"StopLocalTime,omitempty"`
}

func (*SentinelDto) String

func (s *SentinelDto) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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