Encoder-Decoder Portfolio Project 01

Schema-Aware Text-to-SQL Encoder-Decoder

Ask a business question, generate SQLite with a base or LoRA-ready CodeT5 path, inspect schema links, validate and repair the query, then execute it in a read-only sandbox against synthetic analytics data.

CodeT5 + PEFTSchema-aware promptingSQL safetyNext.js + Vercel
Educational demo only. Generated SQL can be incorrect, incomplete, inefficient, or unsafe. This application executes only validated read-only queries against synthetic sample SQLite databases. Never connect it directly to production, confidential, regulated, or personally identifiable data. Human review is required before real-world use.
Step 1

Select a schema

Synthetic data

Synthetic product sales by date, region, and product.

products

  • product_idINTEGER · PK
  • product_nameTEXT
  • categoryTEXT
  • unit_priceREAL

sales

  • sale_idINTEGER · PK
  • sale_dateTEXT
  • regionTEXT
  • product_idINTEGER
  • sales_amountREAL
  • units_soldINTEGER

sales.product_idproducts.product_id

Inspect a SQLite schema locally

The file is opened in your browser with sql.js and is not uploaded to the server. Local inspection is separate from the hosted execution sandbox, which remains restricted to bundled synthetic databases.

Step 2

Ask a business question

Step 3

Generated SQL

No generation yet
Step 4

Validation and safety

Validate the generated SQL before execution.

Schema awareness

Rule-based schema links

0 links

These links are transparent lexical and synonym matches. They are not presented as model-derived schema-link accuracy.

No strong schema links detected yet.

Experiment evidence

RTX 5090 evaluation results

Selected experiment: CodeT5+ 770M LoRA r32.

Exact match

38.4%

Canonical SQL match on held-out records.

Execution accuracy

56.9%

Predicted and reference SQL return equivalent results.

Valid-SQL rate

92.7%

Generated SQL passes schema and safety validation.

Repair success

0.0%

Invalid generations repaired without changing the expected result.

Schema-link F1

Pending

Rule-based linker smoke result until the final labeled study is generated.

Unsafe-query rejection

Pending

Curated destructive and multi-statement inputs rejected.

Average latency

1180.0 ms

Held-out generation latency from the selected model run.

Limitations

What this demo does not claim

The deterministic fallback is not presented as a trained model. New CodeT5/LoRA metrics remain pending until training and evaluation are run locally. The rule-based linker provides interpretable candidates, not learned cross-domain schema-linking. Arbitrary uploaded databases are not executed by the hosted demo.