{"id":47842602,"url":"https://github.com/abbgrade/pssqlclient","last_synced_at":"2026-04-03T21:01:31.428Z","repository":{"id":43340873,"uuid":"312794437","full_name":"abbgrade/PsSqlClient","owner":"abbgrade","description":"The PowerShell SQL Client module aims to replace to the SQL Server utilities SQLCMD and BCP","archived":false,"fork":false,"pushed_at":"2025-12-18T19:12:30.000Z","size":239,"stargazers_count":0,"open_issues_count":16,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-20T20:52:11.903Z","etag":null,"topics":["azure-sql","powershell","sql","sql-server","sqlserver"],"latest_commit_sha":null,"homepage":"https://abbgrade.github.io/PsSqlClient/","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abbgrade.png","metadata":{"files":{"readme":"Readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["abbgrade"]}},"created_at":"2020-11-14T10:31:57.000Z","updated_at":"2025-12-18T09:53:14.000Z","dependencies_parsed_at":"2023-11-29T20:38:19.054Z","dependency_job_id":null,"html_url":"https://github.com/abbgrade/PsSqlClient","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/abbgrade/PsSqlClient","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbgrade%2FPsSqlClient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbgrade%2FPsSqlClient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbgrade%2FPsSqlClient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbgrade%2FPsSqlClient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abbgrade","download_url":"https://codeload.github.com/abbgrade/PsSqlClient/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbgrade%2FPsSqlClient/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31377117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T17:53:18.093Z","status":"ssl_error","status_checked_at":"2026-04-03T17:53:17.617Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure-sql","powershell","sql","sql-server","sqlserver"],"created_at":"2026-04-03T21:01:30.693Z","updated_at":"2026-04-03T21:01:31.418Z","avatar_url":"https://github.com/abbgrade.png","language":"PowerShell","funding_links":["https://github.com/sponsors/abbgrade"],"categories":[],"sub_categories":[],"readme":"# Readme\n\nThe PowerShell SQL Client module replaces the SQL Server utilities [SQLCMD](https://docs.microsoft.com/de-de/sql/tools/sqlcmd-utility) and [BCP](https://docs.microsoft.com/en-us/sql/tools/BCP-utility) with native PowerShell commands. It is part of [PsSqlUtils](https://github.com/abbgrade/PsSqlUtils).\n\nFor details, visit the [GitHub Pages](https://abbgrade.github.io/PsSqlClient/).\n\n## Installation\n\nThis module can be installed from [PsGallery](https://www.powershellgallery.com/packages/PsSqlClient).\n\n```powershell\nInstall-Module -Name PsSqlClient -Scope CurrentUser\n```\n\nAlternatively it can be build and installed from source.\n\n1. Install the development dependencies\n2. Download or clone it from GitHub\n3. Run the installation task:\n\n```powershell\nInvoke-Build Install\n```\n\n## Usage\n\nSee [the command reference](./docs/) for descriptions and examples.\n\n### Copy from CSV to SQL database\n\n```powershell\n# connect to a SQL Server using your current Windows login\nConnect-TSqlInstance -DataSource '(LocalDb)\\MSSQLLocalDB'\n\n# create a temporary table with the columns of your CSV file\nInvoke-TSqlCommand 'CREATE TABLE #Test (Id INT NULL, Name NVARCHAR(MAX))'\n\n# copy the data from CSV to the SQL table\nImport-Csv 'test.csv' | Export-TSqlTable '#Test'\n```\n\n### Get a single value\n\n```powershell\n# connect to a SQL Server using your current Windows login\nConnect-TSqlInstance -DataSource '(LocalDb)\\MSSQLLocalDB'\n\n# get a scalar value from the database\n[string] $databaseName = Get-TSqlValue 'SELECT DB_NAME()'\n```\n\n### Parameterize a query and process results in a pipeline\n\n```powershell\n# connect to a SQL Server using your current Windows login\nConnect-TSqlInstance -DataSource '(LocalDb)\\MSSQLLocalDB'\n\n# get a result from the database and filter the first five by name\nInvoke-TSqlProcedure 'sp_tables' @{ 'table_qualifier' = 'master' } |\n    Sort-Object TABLE_NAME |\n    Select-Object -First 5\n```\n\n## Commands\n\n| Command                                | Description                                            | Status  |\n| -------------------------------------- | ------------------------------------------------------ | ------- |\n| Connect-Instance                       | Create a new database connection.                      | \u0026#9744; |\n| \u0026#11185; by Connection String          | Use a custom connection string.                        | \u0026#9745; |\n| \u0026#11185; by Properties                 | Use specific properties for host, database, user, etc. | \u0026#9745; |\n| \u0026#11185; with AD credentials           | Use integrated security                                | \u0026#9745; |\n| \u0026#11185; to Azure SQL                  | Connect to Azure SQL (token-based)                     | \u0026#9744; |\n| \u0026#11185; to Azure SQL                  | Connect to Azure SQL (AAD)                             | \u0026#9745; |\n| \u0026#11185; global connection             | Save and reuse the connection                          | \u0026#9745; |\n| Disconnect-Instance                    | Close connection                                       | \u0026#9745; |\n| Invoke-Command                         | Execute stored procedure or select data                | \u0026#9745; |\n| \u0026#11185; Procedure instead of SQL text | Execute procedure by procedure name                    | \u0026#9745; |\n| \u0026#11185; SQL text from file            | Execute sql command from file                          | \u0026#9745; |\n| Export-Table                           | Insert data                                            | \u0026#9745; |\n| \u0026#11185; show progress                 | show how many rows already inserted                    | \u0026#9744; |\n\n## Changelog\n\nSee the [changelog](./CHANGELOG.md) file.\n\n## Development\n\n[![.github/workflows/build-validation.yml](https://github.com/abbgrade/PsSqlClient/actions/workflows/build-validation.yml/badge.svg?branch=develop)](https://github.com/abbgrade/PsSqlClient/actions/workflows/build-validation.yml)\n\n- This is a [Portable Module](https://docs.microsoft.com/de-de/powershell/scripting/dev-cross-plat/writing-portable-modules?view=powershell-7) based on [PowerShell Standard](https://github.com/powershell/powershellstandard) and [.NET Standard](https://docs.microsoft.com/en-us/dotnet/standard/net-standard).\n- [VSCode](https://code.visualstudio.com) is recommended as IDE. [VSCode Tasks](https://code.visualstudio.com/docs/editor/tasks) are configured.\n- Build automation is based on [InvokeBuild](https://github.com/nightroman/Invoke-Build)\n- Documentation is based on [platyPs](https://github.com/PowerShell/platyPS)\n- Test automation is based on [Pester](https://pester.dev)\n- Commands are named based on [Approved Verbs for PowerShell Commands](https://docs.microsoft.com/de-de/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands)\n- This project uses [git-flow](https://github.com/nvie/gitflow).\n- This project uses [keep a changelog](https://keepachangelog.com/en/1.0.0/).\n- This project uses [PsBuildTasks](https://github.com/abbgrade/PsBuildTasks).\n\n### Build\n\nThe build scripts require InvokeBuild. If it is not installed, install it with the command `Install-Module InvokeBuild -Scope CurrentUser`.\n\nYou can build the module using the VS Code build task or with the command `Invoke-Build Build`.\n\n### Testing\n\nThe tests scripts are based on Pester. If it is not installed, install it with the command `Install-Module Pester -Force -SkipPublisherCheck`. Some tests require a SQL Server. Therefore the module PsSqlTestServer is used, that can be installed by `Install-Module PsSqlTestServer -Scope CurrentUser`. The test creates a SQL Server in a Docker container. If needed, [install Docker](https://www.docker.com/get-started). The container are created using PSDocker, which can be installed using `Install-Module PSDocker -Scope CurrentUser`.\n\nFor local testing use the VSCode test tasks or execute the test scripts directly or with `Invoke-Pester`.\nThe InvokeBuild test tasks are for CI and do not generate console output.\n\n### Release\n\n1. Create a release branch using git-flow.\n2. Update the version number in the module manifest.\n3. Extend the changelog in this readme.\n4. If you want to create a pre-release.\n   1. Push the release branch to github, to publish the pre-release to PsGallery.\n5. Finish release using git-flow.\n6. Check if tags are not pushed to github.\n7. Check if the release branch is deleted on github.\n8. Create the release on github.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabbgrade%2Fpssqlclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabbgrade%2Fpssqlclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabbgrade%2Fpssqlclient/lists"}