Là một dự án dữ liệu, plasma-umass/sqlwrite đã đạt 124 sao trên GitHub, ngôn ngữ C. SQLwrite: AI in your DBMS! Automatically converts natural language queries to SQL.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Integrates AI into your database: automatically converts natural
language queries into SQL, and then runs the SQL query. As far as we
are aware, this is the first integration of LLMs to enable natural
language queries into a production database manager. Currently works
as an extension to SQLite3 (more to come). In addition to generating
queries, SQLwrite also produces suggestions to improve query
performance (e.g., creating new indices).
Supported AI Providers
SQLwrite supports two AI backends:
Option 1: OpenAI (GPT-4)
export OPENAI_API_KEY=<your-api-key>
Get a key at: https://platform.openai.com/account/api-keys
AWS Bedrock uses Claude 3 Sonnet by default. Ensure you have enabled Claude model access in your AWS Bedrock console.
Examples
These example queries use a large SQLite database with multiple tables:
Getting started
% export OPENAI_API_KEY=<your-api-key> # or use AWS credentials
% ./sqlite3 Chinook_Sqlite.sqlite
sqlite> .load sqlwrite
SQLwrite extension successfully initialized. You can now use natural language queries like "select ask('show me all artists.');".
Please report any issues to https://github.com/plasma-umass/sqlwrite/issues/new
Basic queries
sqlite> select ask('show me the total invoiced for all artists.');
2328.6
[SQLwrite] translation to SQL: SELECT SUM(Total) AS total_invoiced FROM Invoice;
[SQLwrite] indexing suggestions to improve the performance for this query:
(1): CREATE INDEX idx_invoice_total ON Invoice (Total);
(2): CREATE INDEX idx_customer_invoice ON Invoice (CustomerId);
Queries with JOINs
sqlite> select ask('show me the total invoiced for all artists whose last name starts with "S"');
306.98
[SQLwrite] translation to SQL: SELECT sum(Invoice.Total) as total_invoiced FROM Invoice JOIN Customer ON Invoice.CustomerId = Customer.CustomerId WHERE Customer.LastName LIKE 'S%'
[SQLwrite] indexing suggestions to improve the performance for this query:
(1): CREATE INDEX idx_invoice_customer_lastname ON Invoice (CustomerId) WHERE (CustomerId IN (SELECT CustomerId FROM Customer WHERE LastName LIKE 'S%'))
(2): CREATE INDEX idx_customer_lastname ON Customer (LastName)
Complex query synthesis with multiple JOINs
sqlite> select ask('give me a list of all artists (with no duplicates) whose genre is reggae');
Cidade Negra
Lenny Kravitz
UB40
[SQLwrite] translation to SQL: SELECT DISTINCT Artist.Name FROM Artist JOIN Album ON Album.ArtistId = Artist.ArtistId JOIN Track ON Track.AlbumId = Album.AlbumId JOIN Genre ON Track.GenreId = Genre.GenreId WHERE Genre.Name = 'Reggae';
[SQLwrite] indexing suggestions to improve the performance for this query:
(1): CREATE INDEX [IFK_TrackGenreReggae] ON [Track] ([GenreId]) WHERE Name = 'Reggae';
Natural languages besides English!
sqlite> select ask('Haz una lista de todos los músicos cuyos nombres empiezan con la letra L');
22|Led Zeppelin
33|Luiz Melodia
99|Legião Urbana
100|Lenny Kravitz
101|Lulu Santos
149|Lost
162|Los Lonely Boys
187|Los Hermanos
201|Luciana Souza/Romero Lubambo
223|London Symphony Orchestra & Sir Charles Mackerras
227|Luciano Pavarotti
228|Leonard Bernstein & New York Philharmonic
258|Les Arts Florissants & William Christie
[SQLwrite] translation to SQL: SELECT * FROM Artist WHERE Name LIKE 'L%';
[SQLwrite] indexing suggestions to improve the performance for this query:
(1): CREATE INDEX [IFK_ArtistName] ON [Artist] ([Name]);
After building, run the SQLite shell with sqlwrite built-in:
cd build
LD_LIBRARY_PATH=. ./sqlwrite-bin my_database.db
The ask() function is automatically available - no need to load the extension:
SQLwrite extension initialized with AWS Bedrock (Claude).
Use natural language queries like: select ask('show me all artists.');
sqlite> select ask('show me all customers from France');
Loading as Extension
You can also load sqlwrite into any SQLite shell that supports extensions:
SQLwrite includes SQLite3 (https://www.sqlite.org/index.html), and is
built with the assistance of several excellent libraries, whose code
is (for now) included in this repository:
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/plasma-umass/sqlwrite là nguồn chính thức.
plasma-umass/sqlwrite có bao nhiêu sao?
plasma-umass/sqlwrite có 124 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/plasma-umass/sqlwrite. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
plasma-umass/sqlwrite có phải mã nguồn mở không?
Có — plasma-umass/sqlwrite phát hành theo license Apache-2.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/plasma-umass/sqlwrite.
plasma-umass/sqlwrite còn đang phát triển không?
Commit gần nhất trên plasma-umass/sqlwrite là 9 tháng trước (theo timestamp GitHub). Repo có 12 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
plasma-umass/sqlwrite là gì?
plasma-umass/sqlwrite (plasma-umass/sqlwrite) là dự án C trên GitHub. Theo mô tả gốc: SQLwrite: AI in your DBMS! Automatically converts natural language queries to SQL.
plasma-umass/sqlwrite so với các dự án Data khác thế nào?
plasma-umass/sqlwrite được TopGit xếp vào nhóm Data, với 124 sao GitHub và viết bằng C. Xem trang chủ đề Data trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về sqlwrite?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về sqlwrite.