
A powerful PostgreSQL database with built-in AI capabilities for generating SQL queries from natural language.
Edit the config file ~/.pg_ai.config to set at least one API key:
Use the connection string from the service instructions.
-- Generate queries from natural language
SELECT generate_query('show all customers who registered in the last 30 days');
-- Explore your database structure
SELECT get_database_tables();
SELECT get_table_details('users');
-- Analyze query performance
SELECT explain_query('SELECT * FROM users WHERE created_at > NOW() - INTERVAL ''7 days''');
-- Business analytics
SELECT generate_query('monthly sales trend for the last year by category');
-- Customer insights
SELECT generate_query('top 10 customers by total purchase amount');
-- Data quality
SELECT generate_query('find duplicate email addresses in the users table');
-- Complex joins
SELECT generate_query('users who have placed orders but never left a review');