swordfatih

swordfatih / reflect

Public

c++26 reflection-first ORM

10
0
100% credibility
Found May 21, 2026 at 13 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
C++
AI Summary

Reflect is a C++ library that makes working with databases feel natural and intuitive. Instead of writing SQL by hand, you define your data using regular C++ structs with simple annotations. The library automatically figures out how to store, retrieve, and manage your data in either SQLite or PostgreSQL databases. It handles creating tables, generating queries, validating that your code matches your database, and even managing database changes over time. This is particularly useful for C++ developers who want the power and type safety of C++ while avoiding the complexity of raw SQL.

How It Works

1
💡 You discover a smarter way to work with databases

Instead of writing complex SQL queries by hand, you describe your data once using regular C++ structs and special markers.

2
📝 You define your data model

You write simple C++ structs with small annotations like 'this is a unique email' or 'this field cannot be empty'.

3
🔗 You connect your database

With one line of code, you connect to either a simple file-based database or a powerful server database.

4
🏗️ Your tables are created automatically

The library reads your struct definitions and creates matching database tables, indexes, and relationships.

5
You work with your data
Insert and create

Add new records with a single command, like adding a new user to your system

🔍
Find and search

Search for records using natural conditions like 'find all users with emails ending in @company.com'

✏️
Update and modify

Change existing records, with automatic tracking of when records were last updated

6
Your database stays in sync

The library can verify that your C++ code matches your actual database, catching any mismatches before they cause problems.

🎉 Everything works together seamlessly

Your C++ application talks to your database naturally, with type safety and automatic SQL generation handling all the complexity for you.

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 13 to 10 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is reflect?

Reflect is a C++26 ORM that uses static reflection to derive database operations directly from your structs. Define a plain struct with annotations, and it automatically generates DDL, type-safe CRUD operations, query builders, and migrations. It supports SQLite and PostgreSQL backends, with schema validation that compares your C++ model against the actual database state.

Why is it gaining traction?

The hook is simple: your C++ code is the source of truth. No separate schema files, no code generation steps, no YAML configs. The reflection-first approach means the compiler catches mistakes before runtime, and you get type-safe field predicates for queries. Schema drift detection is built in, so you know when your structs diverge from the database. For C++ developers tired of writing raw SQL or wrestling with ORMs that fight the type system, this feels like the natural way to do database access.

Who should use this?

C++ developers building database-backed applications who want type-safe queries without typical ORM overhead. Good fit for small to medium projects where staying in C++ land matters. Not suitable for teams needing async APIs, connection pooling, or production-grade migration tooling. If you're experimenting with C++26 features and want to see what reflection enables, this is worth a look.

Verdict

With 10 stars and pre-1.0 status, this is experimental software. The 1.0% credibility score reflects its early stage. It shows genuine promise for the reflection-first approach, but production use means accepting missing features like column rename workflows, database-wide drift detection, and async APIs. Watch it, try it in side projects, but do not bet production on it yet.

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.