Documentation ¶
Overview ¶
Package sty_shared
This is the STY-Holdings shared services ¶
NOTES:
None
COPYRIGHT & WARRANTY:
Copyright (c) 2022 STY-Holdings, inc All rights reserved. This software is the confidential and proprietary information of STY-Holdings, Inc. Use is subject to license terms. Unauthorized copying of this file, via any medium is strictly prohibited. Proprietary and confidential Written by <Replace with FULL_NAME> / syacko STY-Holdings, Inc. support@sty-holdings.com www.sty-holdings.com 01-2024 USA 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 ¶
- Variables
- func GetPostgresConnection(dbName, user, password, host, sslMode string, port, timeout, poolMaxConns int) (DBPoolPtr *pgxpool.Pool, errorInfo pi.ErrorInfo)
- func VerifyConnection(dbPoolPtr *pgxpool.Pool, dbName string) (errorInfo pi.ErrorInfo)
- type ConnValues
- type Row
- type Rows
- type Transaction
Constants ¶
This section is empty.
Variables ¶
var (
CTXBackground = context.Background()
)
Functions ¶
func GetPostgresConnection ¶
func GetPostgresConnection( dbName, user, password, host, sslMode string, port, timeout, poolMaxConns int, ) ( DBPoolPtr *pgxpool.Pool, errorInfo pi.ErrorInfo, )
GetPostgresConnection will create a connection to a database. dbName Name of the Postgres database user Account that GetPostgresConnection will use to authenticate password Users password for authentication host Internet DNS or IP address of the server running the instance of Postgres sslMode Type of encryption used for the connection (https://www.postgresql.org/docs/12/libpq-ssl.html for version 12) port Interface the connection communicates with Postgres timeout Number of seconds a request must complete (3 seconds is normal setting)
Customer Messages: None Errors: None Verifications: None
Types ¶
type ConnValues ¶
type Transaction ¶
type Transaction pgx.Tx
Row and Rows are so pgx package doesn't need to be imported everywhere there are queries to the database.