Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosAndroid Police: Samsung is smashing records! #shorts #tech #phones(21.09.2026 um 13:55 Uhr)
YouTube Security Videosheise & c't: Bundesnetzagentur wollte diesen Futterautomaten verbieten(21.09.2026 um 13:53 Uhr)
YouTube Security VideosNeil Patel: Your Google Traffic Isn't An Asset It's A Loan #shorts(21.09.2026 um 14:05 Uhr)
Windows Tipps & SecurityF-14 A Tomcat Top Gun endlich als Revell Klemmbausteinmodell erhältlich(21.09.2026 um 14:27 Uhr)
Sichere ProgrammierungShow the Hand-Back Sample Before Approving an Agent Score(21.09.2026 um 14:15 Uhr)
Sichere ProgrammierungHybrid retrieval in one Postgres query: RRF over tsvector + pgvector(21.09.2026 um 14:15 Uhr)
YouTube Security VideosAndroid Police: Samsung is smashing records! #shorts #tech #phones(21.09.2026 um 13:55 Uhr)
YouTube Security Videosheise & c't: Bundesnetzagentur wollte diesen Futterautomaten verbieten(21.09.2026 um 13:53 Uhr)
YouTube Security VideosNeil Patel: Your Google Traffic Isn't An Asset It's A Loan #shorts(21.09.2026 um 14:05 Uhr)
Windows Tipps & SecurityF-14 A Tomcat Top Gun endlich als Revell Klemmbausteinmodell erhältlich(21.09.2026 um 14:27 Uhr)
Sichere ProgrammierungShow the Hand-Back Sample Before Approving an Agent Score(21.09.2026 um 14:15 Uhr)
Sichere ProgrammierungHybrid retrieval in one Postgres query: RRF over tsvector + pgvector(21.09.2026 um 14:15 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

I Built an AI-Powered Database Schema Explorer for the H0 Hackathon

The following content was created for the purposes of entering the H0 Hackathon. #H0Hackathon You join a new project. The database has 30 tables. No documentation. No ERD. No one remembers why status_v2_legacy exists. Existing tools…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

The following content was created for the purposes of entering the H0 Hackathon. #H0Hackathon






You join a new project. The database has 30 tables. No documentation. No ERD. No one remembers why status_v2_legacy exists.



Existing tools force a tradeoff. pgAdmin gives raw access but no visualization. dbdiagram.io lets you draw schemas but requires manual input that goes stale after every migration. SchemaSpy needs CLI setup and Java. DBeaver is desktop-only — you can't share a link with a new hire.



I looked for a web tool that auto-discovers schemas, visualizes them, documents them, and lets you query them with AI. I found nothing that does all four.



So I built SchemaLens for the H0 Hackathon.






What SchemaLens Does



Paste a PostgreSQL connection string. That's it.



SchemaLens queries information_schema to pull tables, columns, types, constraints, foreign keys, and row estimates. No manual input. No DSL. No install.



From there, you get:






1. Interactive ERD



A full entity-relationship diagram rendered automatically from your real schema. Zoom, pan, click any table to see columns with types, nullability, defaults, and constraints. Foreign keys become edges. The diagram builds itself.






2. Schema Health Scoring



10 automated checks produce a weighted score with letter grade (A–F):




  • Primary keys present

  • Foreign key validity

  • Naming conventions

  • Column types

  • NOT NULL constraints

  • Timestamps

  • Oversized columns

  • Unique constraints

  • Boolean naming

  • Column count



Each finding includes a severity level and suggested fix.






3. AI Schema Agent



This is the feature I'm most proud of. An AI assistant that understands your schema and executes queries against your live database.



Ask in plain English:




"Show me all users who signed up last month"




The agent writes the query, validates it, runs it against your actual database, shows results in a table, and auto-retries on errors.



The tool-calling pipeline:




generate_sql → check_sql → execute_sql → retry loop






You see the agent's reasoning, tool calls, and results streaming in real-time.






4. Shareable Links



One click generates a public URL. Your team sees the full ERD and docs without signing up.






The Security Model



This was the hardest part. The AI agent generates and executes SQL against a live database. That's terrifying.



Two-layer defense:





  1. Application layer — blocks destructive keywords (INSERT, UPDATE, DELETE, DROP, ALTER, TRUNCATE) and injection attempts via regex


  2. Database layer — PostgreSQL itself is set to READ ONLY mode, rejecting any write regardless of what the application misses



Even if the AI generates an INSERT, PostgreSQL rejects it. The agent cannot write data.



This is defense in depth, not just a prompt telling the AI to be nice.






How I Built It












































Layer Technology
Framework Next.js 16, React, TypeScript
UI Tailwind v4, shadcn/ui, React Flow
Auth better-auth (email/password)
ORM Drizzle ORM
Database Amazon Aurora PostgreSQL 16
LLM OpenAI-compatible (DeepSeek V4 Flash)
AI SDK Vercel AI SDK — streamText + tool calling
Deployment Vercel


Aurora PostgreSQL is doing the heavy lifting:




  • Auto-discovers schemas from the system catalog

  • Stores schema snapshots as JSONB

  • Handles user data, sessions, chat history, and conversations

  • Serverless scaling — no always-on servers



The Vercel + Aurora combo is legit. Not just a hackathon shortcut — clean integration, fast deploys, real scaling potential.






Challenges I Hit






SSL for Aurora on Vercel



Aurora requires SSL but the database driver rejects self-signed certs. Connection pool failed silently until I configured it to accept the certificate chain. Silent failures are the worst.






Better-auth Drizzle Adapter



Table key naming mismatch caused silent auth failures. The handler swallowed errors and returned empty responses. Had to debug the handler output to find the real error.






AI Agent SQL Safety



Getting the self-correcting retry loop to work reliably with real-time streaming took significant effort. When the AI generates invalid SQL, it reads the database error, fixes the query, and retries automatically.






Schema Health Tuning



What looks good on paper (check every table for primary keys) produces noise on real schemas. Each check needed iteration to balance sensitivity with specificity.






What I Learned




  1. PostgreSQL's system catalog is rich — the database already knows everything about itself. You just have to ask.


  2. AI agents need guardrails, not just prompts — the schema chat works because of defense in depth.


  3. Self-correcting agents need boundaries — the generate → validate → execute → retry loop lets the agent fix its own mistakes, but you need clear retry limits.


  4. Vercel + Aurora is production-ready — not just a hackathon shortcut.







Try It Yourself




  1. Go to schemalens-alpha.vercel.app

  2. Sign up for a free account

  3. Click "Connect database"

  4. Paste your PostgreSQL connection string (any PostgreSQL DB works — Aurora, Railway, Supabase, etc.)


  5. The ERD renders automatically



  6. Open Schema Chat and try:




    • "list all tables"

    • "which tables have no foreign keys?"

    • "show me the 5 largest tables by row count"

    • "if I delete a connector, which related data would be affected?"



  7. Click "Share" to generate a public link







What's Next





  • Schema diff — re-introspect to see what changed


  • Export — SQL migrations, dbdiagram.io DSL, markdown docs


  • Team features — shared schema libraries, RBAC, Slack integration


  • Multi-database — MySQL, SQLite, MongoDB


  • Schema monitoring — scheduled re-introspection with drift alerts






Source Code



GitHub: github.com/faizalmy/schemalens






Built with ❤️ for the #H0Hackathon. Thanks to AWS Aurora and Vercel for the platforms.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten I Built an AI-Powered Database Schema Explorer for the H0 Hackathon

Thematisch verwandte Begriffe: Built, AIPowered, Database, Schema · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-94097 | A vulnerability was determined in Netcore NBR200V2 1.3.241127.071246. Th…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick