postgresql

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Copyright © 2020 Marvin

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	Ctx    context.Context
	DBConn *sql.DB
}

func NewDatabase

func NewDatabase(ctx context.Context, datasource *datasource.Datasource) (*Database, error)

func (*Database) Close

func (d *Database) Close() error

func (*Database) ExecContext

func (d *Database) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)

func (*Database) FilterDatabaseTable

func (d *Database) FilterDatabaseTable(sourceSchema string, includeTableS, excludeTableS []string) ([]string, error)

func (*Database) FindDatabaseTableBestColumn

func (d *Database) FindDatabaseTableBestColumn(schemaNameS, tableNameS, columnNameS string) ([]string, error)

func (*Database) GeDatabaseInstance

func (d *Database) GeDatabaseInstance() ([]map[string]string, error)

func (*Database) GeneralQuery

func (d *Database) GeneralQuery(query string) ([]string, []map[string]string, error)

func (*Database) GetDatabaseCharset

func (d *Database) GetDatabaseCharset() (string, error)

func (*Database) GetDatabaseClusteredTable

func (d *Database) GetDatabaseClusteredTable(schemaName string) ([]string, error)

func (*Database) GetDatabaseCollation

func (d *Database) GetDatabaseCollation() (string, error)

func (*Database) GetDatabaseConsistentPos

func (d *Database) GetDatabaseConsistentPos() (uint64, error)

func (*Database) GetDatabaseGlobalName

func (d *Database) GetDatabaseGlobalName() (string, error)

func (*Database) GetDatabaseMaterializedView

func (d *Database) GetDatabaseMaterializedView(schemaName string) ([]string, error)

func (*Database) GetDatabaseParameters

func (d *Database) GetDatabaseParameters() (string, string, string, string, error)

func (*Database) GetDatabasePartitionTable

func (d *Database) GetDatabasePartitionTable(schemaName string) ([]string, error)

func (*Database) GetDatabasePlatformName

func (d *Database) GetDatabasePlatformName() (string, string, string, error)

func (*Database) GetDatabaseRole

func (d *Database) GetDatabaseRole() (string, error)

func (*Database) GetDatabaseSchema

func (d *Database) GetDatabaseSchema() ([]string, error)

func (*Database) GetDatabaseSchemaCodeObject

func (d *Database) GetDatabaseSchemaCodeObject(schemaName []string) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaCollation

func (d *Database) GetDatabaseSchemaCollation(schemaName string) (string, error)

func (*Database) GetDatabaseSchemaColumnDataDefaultCounts

func (d *Database) GetDatabaseSchemaColumnDataDefaultCounts(schemaName []string) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaColumnTypeCounts

func (d *Database) GetDatabaseSchemaColumnTypeCounts(schemaName []string) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaConstraintTypeCounts

func (d *Database) GetDatabaseSchemaConstraintTypeCounts(schemaName []string) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaIndexTypeCounts

func (d *Database) GetDatabaseSchemaIndexTypeCounts(schemaName []string) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaMaterializedViewObject

func (d *Database) GetDatabaseSchemaMaterializedViewObject(schemaName []string) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaNameALL

func (d *Database) GetDatabaseSchemaNameALL() ([]string, error)

func (*Database) GetDatabaseSchemaNameSingle

func (d *Database) GetDatabaseSchemaNameSingle(schemaNameS string) (string, error)

func (*Database) GetDatabaseSchemaObjectTypeCounts

func (d *Database) GetDatabaseSchemaObjectTypeCounts(schemaName []string) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaPartitionTableCountsOverLimit

func (d *Database) GetDatabaseSchemaPartitionTableCountsOverLimit(schemaName []string, limit int) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaPartitionTableType

func (d *Database) GetDatabaseSchemaPartitionTableType(schemaName []string) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaPartitionTypeCounts

func (d *Database) GetDatabaseSchemaPartitionTypeCounts(schemaName []string) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaSubPartitionTypeCounts

func (d *Database) GetDatabaseSchemaSubPartitionTypeCounts(schemaName []string) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaSynonymObject

func (d *Database) GetDatabaseSchemaSynonymObject(schemaName []string) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaTableAvgRowLengthOverLimitMB

func (d *Database) GetDatabaseSchemaTableAvgRowLengthOverLimitMB(schemaName []string, limitMB int) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaTableAvgRowLengthTOP

func (d *Database) GetDatabaseSchemaTableAvgRowLengthTOP(schemaName []string, top int) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaTableColumnCountsOverLimit

func (d *Database) GetDatabaseSchemaTableColumnCountsOverLimit(schemaName []string, limit int) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaTableColumnNameLengthOverLimit

func (d *Database) GetDatabaseSchemaTableColumnNameLengthOverLimit(schemaName []string, limit int) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaTableIndexCountsOverLimit

func (d *Database) GetDatabaseSchemaTableIndexCountsOverLimit(schemaName []string, limit int) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaTableIndexLengthOverLimit

func (d *Database) GetDatabaseSchemaTableIndexLengthOverLimit(schemaName []string, limit int) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaTableIndexNameLengthOverLimit

func (d *Database) GetDatabaseSchemaTableIndexNameLengthOverLimit(schemaName []string, limit int) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaTableIndexOverview

func (d *Database) GetDatabaseSchemaTableIndexOverview(schemaNameS []string) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaTableNameLengthOverLimit

func (d *Database) GetDatabaseSchemaTableNameLengthOverLimit(schemaName []string, limit int) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaTableRowsTOP

func (d *Database) GetDatabaseSchemaTableRowsTOP(schemaName []string, top int) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaTableSequenceNameLengthOverLimit

func (d *Database) GetDatabaseSchemaTableSequenceNameLengthOverLimit(schemaName []string, limit int) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaTableSpecialDatatype

func (d *Database) GetDatabaseSchemaTableSpecialDatatype(schemaName []string, specialDatatype string) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaTableTypeCounts

func (d *Database) GetDatabaseSchemaTableTypeCounts(schemaName []string) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaTableViewNameLengthOverLimit

func (d *Database) GetDatabaseSchemaTableViewNameLengthOverLimit(schemaName []string, limit int) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaTemporaryTableTypeCounts

func (d *Database) GetDatabaseSchemaTemporaryTableTypeCounts(schemaName []string) ([]map[string]string, error)

func (*Database) GetDatabaseSchemaViewTypeCounts

func (d *Database) GetDatabaseSchemaViewTypeCounts(schemaName []string) ([]map[string]string, error)

func (*Database) GetDatabaseSequence

func (d *Database) GetDatabaseSequence(schemaName string) ([]map[string]string, error)

func (*Database) GetDatabaseServerMemorySize

func (d *Database) GetDatabaseServerMemorySize() (string, error)

func (*Database) GetDatabaseServerNumCPU

func (d *Database) GetDatabaseServerNumCPU() (string, error)

func (*Database) GetDatabaseSessionMaxActiveCount

func (d *Database) GetDatabaseSessionMaxActiveCount() ([]map[string]string, error)

func (*Database) GetDatabaseSize

func (d *Database) GetDatabaseSize() (string, error)

func (*Database) GetDatabaseSoftVersion

func (d *Database) GetDatabaseSoftVersion() (string, error)

func (*Database) GetDatabaseTable

func (d *Database) GetDatabaseTable(schemaName string) ([]string, error)

func (*Database) GetDatabaseTableCharset

func (d *Database) GetDatabaseTableCharset(schemaName string, tableName string) (string, error)

func (*Database) GetDatabaseTableCheckKey

func (d *Database) GetDatabaseTableCheckKey(schemaName string, tableName string) ([]map[string]string, error)

func (*Database) GetDatabaseTableChunkData

func (d *Database) GetDatabaseTableChunkData(querySQL string, batchSize, callTimeout int, dbCharsetS, dbCharsetT, columnDetailO string, dataChan chan []interface{}) error

func (*Database) GetDatabaseTableChunkTask

func (d *Database) GetDatabaseTableChunkTask(taskName, schemaName, tableName string, chunkSize uint64, callTimeout uint64) ([]map[string]string, error)

func (*Database) GetDatabaseTableCollation

func (d *Database) GetDatabaseTableCollation(schemaName, tableName string) (string, error)

func (*Database) GetDatabaseTableColumnAttribute

func (d *Database) GetDatabaseTableColumnAttribute(schemaNameS, tableNameS, columnNameS string, collationS bool) ([]map[string]string, error)

func (*Database) GetDatabaseTableColumnBucket

func (d *Database) GetDatabaseTableColumnBucket(schemaNameS, tableNameS string, columnNameS, datatypeS string) ([]string, error)

func (*Database) GetDatabaseTableColumnComment

func (d *Database) GetDatabaseTableColumnComment(schemaName string, tableName string) ([]map[string]string, error)

func (*Database) GetDatabaseTableColumnInfo

func (d *Database) GetDatabaseTableColumnInfo(schemaName string, tableName string, collation bool) ([]map[string]string, error)

func (*Database) GetDatabaseTableColumnNameSqlDimensions

func (d *Database) GetDatabaseTableColumnNameSqlDimensions(sqlStr string) ([]string, map[string]string, map[string]string, error)

func (*Database) GetDatabaseTableColumnNameTableDimensions

func (d *Database) GetDatabaseTableColumnNameTableDimensions(schemaName, tableName string) ([]string, error)

func (*Database) GetDatabaseTableComment

func (d *Database) GetDatabaseTableComment(schemaName string, tableName string) ([]map[string]string, error)

func (*Database) GetDatabaseTableCompareData

func (d *Database) GetDatabaseTableCompareData(querySQL string, callTimeout int, dbCharsetS, dbCharsetT string) ([]string, uint32, map[string]int64, error)

func (*Database) GetDatabaseTableCsvData

func (d *Database) GetDatabaseTableCsvData(querySQL string, callTimeout int, taskFlow, dbCharsetS, dbCharsetT, columnDetailO string, escapeBackslash bool, nullValue, separator, delimiter string, dataChan chan []string) error

func (*Database) GetDatabaseTableForeignKey

func (d *Database) GetDatabaseTableForeignKey(schemaName string, tableName string) ([]map[string]string, error)

func (*Database) GetDatabaseTableNormalIndex

func (d *Database) GetDatabaseTableNormalIndex(schemaName string, tableName string) ([]map[string]string, error)

func (*Database) GetDatabaseTableOriginStruct

func (d *Database) GetDatabaseTableOriginStruct(schemaName, tableName, tableType string) (string, error)

func (*Database) GetDatabaseTablePartitionExpress

func (d *Database) GetDatabaseTablePartitionExpress(schemaName string, tableName string) ([]map[string]string, error)

func (*Database) GetDatabaseTablePrimaryKey

func (d *Database) GetDatabaseTablePrimaryKey(schemaName string, tableName string) ([]map[string]string, error)

func (*Database) GetDatabaseTableRows

func (d *Database) GetDatabaseTableRows(schemaName, tableName string) (uint64, error)

func (*Database) GetDatabaseTableSize

func (d *Database) GetDatabaseTableSize(schemaName, tableName string) (float64, error)

func (*Database) GetDatabaseTableType

func (d *Database) GetDatabaseTableType(schemaName string) (map[string]string, error)

func (*Database) GetDatabaseTableUniqueIndex

func (d *Database) GetDatabaseTableUniqueIndex(schemaName string, tableName string) ([]map[string]string, error)

func (*Database) GetDatabaseTableUniqueKey

func (d *Database) GetDatabaseTableUniqueKey(schemaName string, tableName string) ([]map[string]string, error)

func (*Database) GetDatabaseTemporaryTable

func (d *Database) GetDatabaseTemporaryTable(schemaName string) ([]string, error)

func (*Database) GetDatabaseUsernameLengthOverLimit

func (d *Database) GetDatabaseUsernameLengthOverLimit(schemaName []string, limit int) ([]map[string]string, error)

func (*Database) GetDatabaseVersion

func (d *Database) GetDatabaseVersion() (string, error)

func (*Database) PingDatabaseConnection

func (d *Database) PingDatabaseConnection() error

func (*Database) PrepareContext

func (d *Database) PrepareContext(ctx context.Context, sqlStr string) (*sql.Stmt, error)

func (*Database) QueryContext

func (d *Database) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)

Jump to

Keyboard shortcuts

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