Posts

Script a SQL Server Database to a .sql File — With the Data, Not Just the Schema (No Wizard Needed)

Image
Here is a restore that "worked". The script ran clean — no errors, nothing red — and rebuilt the database perfectly… except every table came back with zero rows . The shape was copied. The data never was. It is the most common Generate Scripts mistake there is, and it fails silently. The fix is one setting. But to see it clearly, it helps to know what the Generate Scripts wizard in SSMS actually is : a front-end . Clicking through it does not write your script — it collects your choices, sets them as options on SQL Server's scripting engine (SMO, the Scripter), and lets the engine write the file. In this post we call that engine directly, from the terminal, with Microsoft's own scripter tool — same engine, same output file — and we count the rows before and after, twice. Every output below is from the real run (SQL Server 2025, on Linux). The map — everything follows it: a database → the Scripter → one .sql file → a new database that proves the copy. W...

Build a RAG App with FastAPI — MiniLM Embeddings, a Chroma Store, and a Refusal That Works, Step by Step

Image
Ask a language model about your documents — your shop's prices, your team's manual — and it will still answer. Confidently, and wrong: it is guessing from its training, not reading your page. RAG — retrieval-augmented generation — is the fix: keep your documents in a searchable store, fetch the few chunks that match the question, and let the model answer from those chunks only. An answer built that way is called grounded . In this post we build the whole thing with FastAPI: a small shop catalogue goes in, grounded answers come out — including the two moments most demos skip: the app refusing when the answer is not in the documents, and the app going stale when a document changes. Every output below is from the real run. The map — everything follows it, in two rows. Index time (runs when documents change): documents → chunks → embeddings → store. Query time (runs per question): question → retrieve → prompt → model → answer. What you need Python 3.10 or newer....

Connect a FastAPI App to Oracle AI Database — Thin Mode + Wallet, a Real Pool, Step by Step

Image
Your FastAPI app is useless without a database — and connecting Python to Oracle used to mean installing a heavy client and hunting for config files. Not anymore. One pip install, a small key file called a wallet, and a real connection pool. By the end of this post your app will answer live requests from a real Oracle database — and you will have proof inside the database itself. The map — everything follows it: a user sends a request → it lands on our FastAPI app → the app borrows a connection from a pool (connections kept open and ready, like taxis at a rank) → the pool talks to Oracle AI Database , which stores our rows and answers questions in SQL . Every step below lights one leg of this map. What you need Python 3.10 or newer. An Oracle Cloud account (the free tier is enough — this whole tutorial costs $0 ). About 20 minutes. Step 1 — Meet the database Oracle AI Database is Oracle's database service in the cloud: you install nothing; Oracle runs it, you just c...

Build Your Own Coding Agent in Python — A Beginner's Step-by-Step Guide (Every Step Explained)

Image
An AI agent is a program that thinks with an AI model and acts through tools. In this beginner-friendly build, you will write one small Python program — a coding agent — hand it a real failing test, and watch it find the bug, propose the exact fix, and then stop and wait for your permission before it changes anything. By the end, a test suite that starts at 1 failed, 3 passed ends at 4 passed , and the whole run costs less than one cent. Every step is explained in plain words, with a screenshot — no experience with agents is assumed. This is the beginner-first edition of our coding-agent build. If you already know what an agent is and want the denser reference version, read the original build instead: Build Your Own Coding Agent in Python (It Fixes Real Code — Behind an Approval Gate) . This post covers the same machine more slowly, and adds the two things beginners asked for: what every part means , and what to do when it breaks. What you need (versions used in this post) ...