Home / Companies / Stainless / Blog / Post Details
Content Deep Dive

Introducing the (experimental!) Stainless SQL SDK generator

Blog post from Stainless

Post Details
Company
Date Published
Author
Tomer Aberbach
Word Count
1,683
Language
English
Hacker News Points
-
Summary

An experimental SQL SDK generator has been developed to transform OpenAPI specifications into PostgreSQL extensions, enabling REST API calls to be executed as SQL functions. This approach allows for seamless integration of API data into standard SQL queries without the need for complex ETL processes or intermediary services. The system uses PL/Python for HTTP requests and wraps SQL functions to provide a typed SQL interface, mapping API endpoints to SQL functions and resources to PostgreSQL schemas. This method facilitates the combination of live API data with local database tables, making it effective for analytical and batch workflows, although it is not suitable for low-latency production environments. The generator currently supports OpenAPI 3.x specifications and is in an experimental phase, with feedback being sought from developers to refine and expand its capabilities.