Maintenance knowledge of sqlalchemy_upsert_kit, the bulk upsert library for SQLAlchemy: its one job (three upsert strategies on several database backends), the core versus per-backend architecture and why, how each backend's strategies behave, the local database mise tasks, and how each backend is tested locally and in CI. Load it before changing the package, its tests, its mise tasks, or its CI in this repo.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Maintain Sqlalchemy Upsert Kit Base?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/machu-gwu-maintain-sqlalchemy-upsert-kit-base)
---
name: maintain-sqlalchemy_upsert_kit-base
description: "Maintenance knowledge of sqlalchemy_upsert_kit, the bulk upsert library for SQLAlchemy: its one job (three upsert strategies on several database backends), the core versus per-backend architecture and why, how each backend's strategies behave, the local database mise tasks, and how each backend is tested locally and in CI. Load it before changing the package, its tests, its mise tasks, or its CI in this repo."
---
sqlalchemy_upsert_kit does one thing: three bulk upsert strategies (insert or ignore, insert or replace, insert or merge), each staged through a temporary table, on several database backends. Everything that is the same on every database lives in `sqlalchemy_upsert_kit/core/`: input validation, the staging table, and the workflow (`UpsertExecutor`), which runs each call inside one SAVEPOINT. Each backend is its own subpackage, `sqlalchemy_upsert_kit/<engine>/` (today `sqlite/`, `postgres/` and `mysql/`), exposed as `api.<engine>`: its executor overrides only the hooks its database needs (the upsert statement always; how a transaction begins, how the staging table is dropped and cleaned up, how rows are counted, the identifier limit, and a check of other unique keys where the database differs), and its three modules hold the public functions. One shared contract suite, `sqlalchemy_upsert_kit/tests/contract.py`, tests every backend the same way.
For template conventions (layout, code style, tests, docs, release), load `pywf-oss-base`. This family records only what is specific to this library.
## References
Numbered in the order a change usually touches them; each cites only earlier ones.
<!-- BEGIN references index: generated by scripts/update_skill_index.py, do not edit by hand -->
- **Scope and Strategy Contract** (`references/01-scope.md`): Read before adding a feature, changing a strategy's behavior, or deciding whether a request belongs in this library.
- **Architecture: Core and Backends** (`references/02-architecture.md`): Read before moving code between core and a backend, or adding shared logic.
- **Backend: SQLite** (`references/03-backend-sqlite.md`): Read before changing the sqlite backend, or when a SQLite upsert commits, locks, or fires triggers unexpectedly.
- **Backend: PostgreSQL** (`references/04-backend-postgres.md`): Read before changing the postgres backend, or when a PostgreSQL upsert's counts or transaction state look wrong.
- **Backend: MySQL** (`references/05-backend-mysql.md`): Read before changing the mysql backend, or when a MySQL upsert commits, leaves a staging table, or updates the wrong row.
- **Local Database Tasks** (`references/06-local-db-tasks.md`): Read before changing or adding a local database task, or when psql-up or mysql-up fails.
- **Testing the Backends** (`references/07-testing.md`): Read before writing or changing tests, or when a backend's tests fail locally or in CI.
<!-- END references index -->
## Which skill to use
| Job | Skill |
| :--- | :--- |
| Add a new database backend (such as MySQL) | `maintain-sqlalchemy_upsert_kit-add-backend` |
| Any other change: read the references above that it touches | this skill |