ProxyR - SQL Server to REST API Middleware

.NET GitHub Pages

ProxyR is a powerful .NET middleware that automatically exposes SQL Server table-valued functions, inline table-valued functions, and views as REST API endpoints. It simplifies the process of creating APIs from your database functions and views with minimal configuration.

Why ProxyR?

Quick Start

1. Install the Package

dotnet add package ProxyR.Middleware

2. Configure Your Services

Add ProxyR to your service collection in Startup.cs:

public void ConfigureServices(IServiceCollection services)
{
    services.AddProxyR(options => options
        .UseConnectionString("your_connection_string")
        .UseDefaultSchema("ProxyR")
        .UseFunctionNamePrefix("Api_")
    );
}

3. Create Your Database Objects

Follow our naming conventions to automatically expose your database objects as API endpoints:

-- Create a view for basic data
CREATE VIEW ProxyR.Api_Users_View AS
SELECT Id, Username, Email
FROM dbo.User;

-- Create a function for searchable grid
CREATE FUNCTION ProxyR.Api_Users_Grid
(
    @SearchTerm NVARCHAR(50) = NULL
)
RETURNS TABLE
AS
RETURN
(
    SELECT Id, Username, Email
    FROM dbo.User
    WHERE (@SearchTerm IS NULL OR Username LIKE '%' + @SearchTerm + '%')
);

These will automatically be exposed as:

4. Enable the Middleware

Add ProxyR to your application pipeline:

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    app.UseProxyR();
}

Documentation

Check out our comprehensive documentation:

Community

License

ProxyR is licensed under the MIT License. See the LICENSE file for details.