github.com/kyleu/dbaudit@v0.0.2-0.20240321155047-ff2f2c940496/doc/module/sqlserver.md (about) 1 <!--- Content managed by Project Forge, see [projectforge.md] for details. --> 2 # SQL Server 3 4 This is a module for [Project Forge](https://projectforge.dev). It provides an API for accessing Microsoft SQL Server databases. 5 6 https://github.com/kyleu/projectforge/tree/master/module/sqlserver 7 8 ### License 9 10 Licensed under [CC0](https://creativecommons.org/publicdomain/zero/1.0) 11 12 ### Usage 13 14 - To configure a SQL Server connection pool, call `database.OpenSQLServerDatabase`, passing `SQLServerParams` 15 - You can load the params from the environment by calling `SQLServerParamsFromEnv` (with optional prefix), this will read the following by default: 16 - `DB_HOST` - hostname to use, defaults to `localhost` 17 - `DB_PORT` - port to use, defaults to 1433 18 - `DB_USER` - username for connections 19 - `DB_PASSWORD` - password for connections (optional) 20 - `DB_DATABASE` - database to use 21 - `DB_SCHEMA` - schema to use (optional) 22 - `DB_MAX_CONNECTIONS` - max active and idle connections 23 - `DB_DEBUG` - if set to `true`, will log all statements and parameters