Skip to content

Commit 95d03cf

Browse files
committed
code refine
1 parent 61b6c2a commit 95d03cf

File tree

6 files changed

+8896
-13
lines changed

6 files changed

+8896
-13
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
# Simple Text to SQL (No RAG)
22

3-
Test
4-
data: [Netflix data](https://github.com/neondatabase/postgres-sample-dbs?tab=readme-ov-file#netflix-data)
3+
Test data: [Netflix data](https://github.com/neondatabase/postgres-sample-dbs?tab=readme-ov-file#netflix-data)
54

65
How to run:
76

87
1. Requires Java 21 to build and run.
9-
2. Download test data and import into a Postgres database.
10-
3. Update database connection in `application.yaml`.
11-
4. Start the server and
12-
use [Swagger UI](http://localhost:8080/swagger-ui/index.html) to run query.
8+
2. Start Postgres database using Docker Compose.
9+
3. Start the server and use [Swagger UI](http://localhost:8080/swagger-ui/index.html) to run query.
1310

1411
Sample query:
1512

@@ -21,4 +18,8 @@ Output:
2118

2219
```text
2320
There are 2,058 movies produced in the United States.
24-
```
21+
```
22+
23+
## Full Text-to-SQL Implementation
24+
25+
For a complete Text-to-SQL implementation, check out my [course](https://www.udemy.com/course/spring-ai-text-to-sql/?referralCode=6180D9A02FA8BA9D4F60).

compose.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
services:
2+
postgres:
3+
image: postgres:16
4+
volumes:
5+
- postgresql-data:/var/lib/postgresql/data
6+
- type: bind
7+
source: sample-db-scripts
8+
target: /docker-entrypoint-initdb.d
9+
environment:
10+
POSTGRES_DB: "postgres"
11+
POSTGRES_USER: "postgres"
12+
POSTGRES_PASSWORD: "postgres"
13+
ports:
14+
- "5432:5432"
15+
volumes:
16+
postgresql-data:

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<properties>
1919
<java.version>21</java.version>
2020
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
21-
<spring-ai.version>1.0.0-M3</spring-ai.version>
21+
<spring-ai.version>1.0.0-M5</spring-ai.version>
2222
</properties>
2323

2424
<dependencyManagement>

0 commit comments

Comments
 (0)