PostgreSQL

The Turboline.NLQ2SQL.PostgresSQL package allows developers to convert natural language queries into SQL for PostgreSQL databases. It integrates seamlessly into .NET applications, enabling users to query databases without needing SQL expertise. The package supports API integration, allowing quick setup and use of a natural language query interface, ideal for AI-driven applications and dashboards. It requires a simple configuration update, including the database connection string and an API key for authentication.

Download Nuget Package

Download your package here.

Objective

To integrate PostgresSQL Turboline Packages into your application efficiently and effectively.

Key Steps

  1. Create a blank project using the ASP.NET web app model view controller.
  2. Choose .NET 8.0 for the project.
  3. Select individual accounts for authentication.
  4. Install the PostgresSQL package from NuGet packages. –dotnet add package Turboline.NLQ2SQL.PostgresSQL.
  5. Add code in the program.cs file:
    • Add namespace using Turboline.NLQ2SQL.PostgreSQL;.
    • Add namespace Turboline.AI.API.Client.Razor;.
    • Add builder.Services.EnableTurbolineDashboard(builder.Configuration).ActivatePostgres();.
    • Add app.UseTurbolineDashboard().ActivatePostgres();.
  6. Update the application settings with the following configurations:
    • Set PostgresSQL as the database type.
    • Provide the connection string for the database.
    • Add an API key obtained from the plan subscription from https://platform.turboline.ai.
    • Set an app name and logo URL.

"NLQ2SQLSettings": {
  "PostgreSQL": {
    "ConnectionString": "<Connectionstring>"
  },
  "APIKey": "",
  "AppName": "Amtev Data Studio, Powered by Turboline",
  "Logo": "https://cdn.turboline.ai/cdn/adminlte/dist/img/TLLogo.png"
}

  1. Run the project to complete the setup.
  2. To access the Turboline NLQ to PostgreSQL, navigate /Turboline/postgres.

Cautionary Notes

  • Ensure correct installation of the PostgresSQL package from NuGet.
  • Double-check the code additions in the program.cs file for accuracy.
  • Securely store and manage the API key obtained from the subscription plan.

Tips for Efficiency

  • Follow the steps sequentially to avoid missing any crucial configurations.
  • Keep all necessary information and URLs handy for quick reference during setup.
  • Test the integration thoroughly after completion to ensure functionality.

By following these steps, you can seamlessly integrate PostgresSQL Turboline Packages into your application within a few minutes.


Tutorial: Generate API Keys


Tutorial: Integrate Turboline Package in Your .NET Application