datalang db to api
1.0.0
曾經想將數據庫視為API嗎?
這是一個.NET 8應用程序,該應用將您的數據庫SQL語句視為API端點。
在appsettings.json中設置ApiKey (不要共享)。
運行應用程序。
dotnet run --project DataLangServer
測試API。
要么訪問http:// localhost:5253/Swagger,要么直接致電API:
curl -X POST
'http://localhost:5253/api/test'
--header 'Accept: */*'
--header 'X-Api-Key: YOUR_API_HERE'
--header 'Content-Type: application/json'
--data-raw '{
"sql": "YOUR_SQL_HERE",
"connectionType": "odbc_or_postgres",
"connectionString": "YOUR_CONNECTION_STRING_HERE"
}'
部署應用程序。
dotnet publish -c Release
Datalang是一個由AI驅動的應用程序,可讓您與數據庫聊天。