SShortSingh.
Back to feed

Local Text-to-SQL Setup Uses DuckDB and Ollama to Keep Sensitive Data On-Device

0
·2 views

Developers building natural language-to-SQL features typically send raw schema and table data to cloud APIs like OpenAI, raising compliance concerns under regulations such as HIPAA and GDPR. A locally run alternative separates schema context from data compute, supplying only table metadata to a local large language model to generate SQL queries. The generated queries are then executed entirely within DuckDB's in-memory engine, ensuring raw data rows never leave the user's hardware. An Abstract Syntax Tree validation layer screens every query before execution, blocking anything other than read-only SELECT statements. This architecture has been implemented in a tool called VeilAnalytics, which is available as a live demo online.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Terrain Tool Auto-Generates Codebase Docs to Help Developers and AI Assistants Onboard Faster

Terrain is an open-source engineering environment management platform designed to help both human developers and AI coding assistants understand unfamiliar codebases quickly. Built on a Git repository foundation, it automatically scans code, generates C4 architecture documentation, and creates structured knowledge assets tailored separately for humans and AI agents. The tool addresses common pain points such as outdated wiki documentation and the inability of AI assistants to grasp project architecture beyond simple file searches. Terrain tracks Git changes incrementally and assigns freshness scores to knowledge assets, so stale information is flagged automatically. Written in Rust as a single offline binary, it supports popular AI coding tools including Claude Code, Codex, and Cursor through a unified interface.

0
ProgrammingDEV Community ·

When to Use Records in .NET: Key Features and Best Practices

A software developer and blogger has outlined the main scenarios where using Records in .NET is beneficial, emphasizing that the choice should be driven by logic rather than novelty. Records offer default immutability, meaning property values cannot be changed on an existing instance — a new one must be created instead. Unlike classes, Records use value-based equality comparison, reducing boilerplate code when checking whether two instances hold the same data. Additional advantages include concise syntax, built-in deconstruction, an auto-generated ToString() method, the 'with' expression for creating modified copies, and seamless pattern matching support. The author stresses that no technology should be applied universally, and a follow-up post will cover situations where Records are not recommended.

0
ProgrammingDEV Community ·

C# Records: Immutable Data Types That Simplify Code and Testing

C# Records were introduced with C# 9 in November 2020, offering a concise way to define immutable data models using minimal code. Unlike traditional classes, Records are immutable by default, meaning their properties can only be assigned at initialization and cannot be changed afterward. A key distinction is that Records use value-based equality rather than reference-based equality, eliminating the need to manually implement Equals and GetHashCode methods. This makes unit testing simpler and reduces boilerplate code compared to writing equivalent immutable classes. Records can also include custom validation logic, making them suitable beyond simple data containers.

0
ProgrammingDEV Community ·

Combining Object Mother Pattern with AutoFixture for Cleaner Unit Tests

A software development tutorial published on DEV Community demonstrates how to combine the Object Mother design pattern with the AutoFixture library in C#. The Object Mother pattern centralizes test object creation, improving test readability and semantic clarity. AutoFixture complements this by automatically generating random test data, reducing manual setup effort. The article walks through a practical example using a User class and age-based access logic, showing how a UserMother class leverages AutoFixture's Build API to produce meaningful test objects. The combination allows developers to maintain expressive, well-organized unit tests without sacrificing flexibility in data generation.