apitools
1.0.3
Designed to be completely dependency-free (no dbatools or SimplySql required), apitools provides:
- Native database connectivity using System.Data.SqlClient and System.Data.Odbc
- Automatic PostgreSQL ODBC driver discovery
- Sample database generation (Hospital schema
Designed to be completely dependency-free (no dbatools or SimplySql required), apitools provides:
- Native database connectivity using System.Data.SqlClient and System.Data.Odbc
- Automatic PostgreSQL ODBC driver discovery
- Sample database generation (Hospital schema) for SQL Server and PostgreSQL
- Complete CRUD Web API scaffolding from existing databases
- Entity Framework Core model and DbContext generation
- Automatic ASP.NET Core controller generation with Swagger integration
- Interactive mode with helpful connection string examples
- ShouldProcess support with -DryRun capability for safe testing
- Cross-platform support (Windows, Linux, macOS)
Built in the spirit of dbatools, apitools gives you powerful API development capabilities with zero external PowerShell dependencies. Only requires .NET SDK and standard CLI tools (dotnet-ef, aspnet-codegenerator).
Perfect for developers who want lightweight, transparent, and scriptable API development workflows!
Minimum PowerShell version
7.0
Installation Options
Owners
Copyright
(c) 2025 Ruslan Dubas. All rights reserved.
Package Details
Author(s)
- Ruslan Dubas
Tags
API Database SQLServer PostgreSQL CRUD WebAPI EntityFramework AspNetCore CodeGeneration Scaffold DependencyFree ODBC RestAPI Swagger Development DotNet Automation DatabaseFirst Sample Testing Windows Linux MacOS
Functions
New-ApiToolsHospitalDb New-ApiToolsCrudApi New-ApiToolsDbFromModels
PSEditions
Dependencies
This module has no dependencies.
Release Notes
## Version 1.0.0
### Features
- ✅ **New-ApiToolsHospitalDb** - Create sample Hospital databases with seed data
- Support for SQL Server and PostgreSQL
- Interactive mode with connection string examples
- Automatic PostgreSQL ODBC driver discovery
- Force rebuild with -Force parameter
- Dry-run mode with -DryRun parameter
- ShouldProcess support with -WhatIf
- Zero PowerShell module dependencies
- ✅ **New-ApiToolsCrudApi** - Generate complete CRUD Web APIs from existing databases
- Automatic database engine detection (SQL Server/PostgreSQL)
- Entity Framework Core model and DbContext scaffolding
- ASP.NET Core controller generation with full CRUD operations
- Swagger UI integration out of the box
- Automatic Program.cs and appsettings.json configuration
- Interactive connection string prompts
- Project naming conflict resolution
- Force overwrite with -Force parameter
- Preview execution with -DryRun parameter
- Native .NET connectivity (no external PowerShell dependencies)
### Design Philosophy
- **Dependency-free**: No external PowerShell modules required (dbatools, SimplySql, etc.)
- **Transparent**: Uses native .NET classes (System.Data.SqlClient, System.Data.Odbc)
- **Cross-platform**: Works on Windows, Linux, and macOS
- **Developer-friendly**: Interactive modes, helpful examples, and clear error messages
- **Safe**: ShouldProcess and -DryRun support for testing before execution
- **Scriptable**: All functions support pipeline input and automation
### Requirements
- PowerShell 7.0 or higher
- .NET SDK 6.0 or higher (for CRUD API generation)
- dotnet-ef global tool (auto-validated, install with: dotnet tool install --global dotnet-ef)
- dotnet-aspnet-codegenerator global tool (auto-validated, install with: dotnet tool install --global dotnet-aspnet-codegenerator)
- PostgreSQL ODBC driver for PostgreSQL support (auto-discovered on Windows)
### Getting Started
```powershell
# Install the module
Install-Module -Name apitools
# Create a sample Hospital database (interactive mode)
New-ApiToolsHospitalDb
# Create a sample Hospital database (automated)
New-ApiToolsHospitalDb -ConnectionString "Server=localhost;Database=master;Trusted_Connection=True;" -DatabaseName "Hospital_db"
# Generate CRUD API from existing database (interactive mode)
New-ApiToolsCrudApi
# Generate CRUD API from existing database (automated)
New-ApiToolsCrudApi -ConnectionString "Server=localhost;Database=Hospital_db;Trusted_Connection=True;" -ProjectName "HospitalAPI"
# Preview what would be created (dry-run)
New-ApiToolsCrudApi -ConnectionString "Server=localhost;Database=mydb;Trusted_Connection=True;" -DryRun
```
### Roadmap
- Additional sample databases (Northwind, AdventureWorks-lite)
- GraphQL API generation support
- Minimal API generation (alternative to controllers)
- Database migration management helpers
- API testing helpers with sample requests
- OpenAPI/Swagger customization options
### Contributing
Contributions welcome! Please visit the GitHub repository to report issues or submit pull requests.
### Inspired By
Built in the spirit of dbatools - providing powerful, dependency-free tooling for the community.
FileList
- apitools.nuspec
- apitools.psd1
- apitools.psm1
- README.md
- Public\New-ApiToolsCrudApi.ps1
- Public\New-ApiToolsDbFromModels.ps1
- Public\New-ApiToolsHospitalDb.ps1
Version History
| Version | Downloads | Last updated |
|---|---|---|
| 1.0.3 (current version) | 7 | 10/25/2025 |