https://github.com/maximgorbatyuk/maximgorbatyuk.databasesqlendpoints
This nuget allows you to view table content of your ASP.NET core application during runtime
https://github.com/maximgorbatyuk/maximgorbatyuk.databasesqlendpoints
netcore nuget nuget-package sql
Last synced: about 1 year ago
JSON representation
This nuget allows you to view table content of your ASP.NET core application during runtime
- Host: GitHub
- URL: https://github.com/maximgorbatyuk/maximgorbatyuk.databasesqlendpoints
- Owner: maximgorbatyuk
- License: mit
- Created: 2021-12-28T13:32:17.000Z (over 4 years ago)
- Default Branch: dev
- Last Pushed: 2023-02-03T14:07:32.000Z (over 3 years ago)
- Last Synced: 2025-04-22T21:16:29.911Z (about 1 year ago)
- Topics: netcore, nuget, nuget-package, sql
- Language: C#
- Homepage:
- Size: 2.04 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MaximGorbatyuk.DatabaseSqlEndpoints
   
This nuget allows you to view table content of your ASP.NET core application during runtime. The nuget creates a special endpoint and then return tables and data represented in html form.
## Get started
1. Install the [nuget](https://www.nuget.org/packages/MaximGorbatyuk.DatabaseSqlEndpoints/):
```bash
dotnet add package MaximGorbatyuk.DatabaseSqlEndpoints
```
2. Add routing line into your `Startup.cs` file before UseEndpoints():
```csharp
class Startup
{
public void Configure(IApplicationBuilder app)
{
// ... some settings
app
.UseSqlEndpoints()
.UseTableOutputEndpoint() // default route is /database-sql-endpoints/table
.UseReadEndpoint() // default route is /database-sql-endpoints/read
.UseExecuteEndpoint(); // default route is /database-sql-endpoints/execute
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
// ... some settings
}
}
```
## Requests
### 1. Table content
Open `https:localhost:5001/database-sql-endpoints/table?tableName=` in your browser and view your data
### 2. Reading some data with the SQL command
Send the following POST request:
```bash
POST https:localhost:5001/database-sql-endpoints/read
BODY:
{
"query": "select 1;"
}
```
### 3. Execute any SQL script
Send the following POST request:
```bash
POST https:localhost:5001/database-sql-endpoints/execute
BODY:
{
"query": "delete fronm users;"
}
```