Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 month 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 (about 3 years ago)
- Default Branch: dev
- Last Pushed: 2023-02-03T14:07:32.000Z (almost 2 years ago)
- Last Synced: 2024-12-02T22:38:13.293Z (about 1 month ago)
- Topics: netcore, nuget, nuget-package, sql
- Language: C#
- Homepage:
- Size: 2.04 MB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MaximGorbatyuk.DatabaseSqlEndpoints
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/maximgorbatyuk/MaximGorbatyuk.DatabaseSqlEndpoints/test.yml?branch=dev) ![Nuget](https://img.shields.io/nuget/dt/MaximGorbatyuk.DatabaseSqlEndpoints) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/maximgorbatyuk/MaximGorbatyuk.DatabaseSqlEndpoints) ![GitHub](https://img.shields.io/github/license/maximgorbatyuk/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 settingsapp
.UseSqlEndpoints()
.UseTableOutputEndpoint() // default route is /database-sql-endpoints/table
.UseReadEndpoint() // default route is /database-sql-endpoints/read
.UseExecuteEndpoint(); // default route is /database-sql-endpoints/executeapp.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;"
}```