Skip to content

Mise Index

SteffenBlake edited this page Sep 28, 2026 · 3 revisions

Mise guide

Mise builds parameterized SQL and maps database rows to application types. It supports SQL Server, PostgreSQL, SQLite, MySQL, and MariaDB.

Start with Database access with Mise for package installation and your first query.

Setup and mappings

  • Database setup: choose packages and supply configuration or an existing connection.
  • Table mappings: define columns, qualifiers, keys, and write metadata.
  • Aliases: reference a table through generated aliases.
  • Relationships: generate forward and reverse join fragments.
  • Result rows: map projections, constructors, nullability, and column names.
  • SQL interpolation: bind values, insert constant references, and inspect compiled SQL.

Read SQL

  • Queries: build projections and sources, and add clauses conditionally.
  • Filtering: combine predicates, match lists, and use IN or EXISTS subqueries.
  • Joins: choose join kinds and map their result shapes.
  • Aggregation: group rows and filter aggregate results.
  • Paging and ordering: choose stable sort keys, offsets, and seek predicates.
  • Subqueries: embed scalar queries and derived sources.
  • Set operations: combine queries with UNION, INTERSECT, and EXCEPT.
  • Common table expressions: name sources and traverse hierarchies recursively.

Execution and writes

  • Readers: choose list, first-row, scalar, or existence terminals.
  • Streaming: enumerate rows while keeping their resources alive.
  • Writers: execute commands and read through the same transaction scope.
  • Inserts: write VALUES rows or insert from a query.
  • Updates: assign values, use scalar sources, and interpret affected counts.
  • Deletes: select deletion scope and choose missing-row behavior.
  • Returned rows: retrieve generated IDs and written values across dialects.
  • Custom SQL and procedures: use full statements, named parameters, and command options.

Transactions and troubleshooting

  • Transactions: enlist a writer, complete work, and use existing transactions.
  • Resource lifetimes: manage connections, streams, concurrency, and disposal order.
  • Database dialects: compare syntax, output support, and mapping behavior.
  • Diagnostics: resolve generator, builder, mapping, and lifecycle errors.

ASP.NET Core integration

See Mise in ASP.NET Core for named connection strings, database bundles, complete handlers, and Provider ownership.

Clone this wiki locally