{"id":48123,"library":"guzu","title":"guzu","description":"SQL-only migration manager for PostgreSQL that enforces immutable migrations with hash verification. Current version is 0.0.8, actively developed. Key differentiators: zero configuration, timestamped migration files, SQL-only (no ORM), built-in hash integrity checking to prevent tampering, and a seed command for migrating from other tools. Inspired by goose. Requires only PostgreSQL as a dependency.","status":"active","version":"0.0.8","language":"javascript","source_language":"en","source_url":"https://github.com/garriguv/guzu","tags":["javascript","database","migrations","postgresql","sql"],"install":[{"cmd":"npm install guzu","lang":"bash","label":"npm"},{"cmd":"yarn add guzu","lang":"bash","label":"yarn"},{"cmd":"pnpm add guzu","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; package.json has type:module. CommonJS require will fail.","wrong":"const guzu = require('guzu')","symbol":"default","correct":"import guzu from 'guzu'"},{"note":"run is the primary programmatic API. as of v0.0.8.","wrong":null,"symbol":"run","correct":"import { run } from 'guzu'"},{"note":"create is an exported function for programmatic use, but CLI is the common usage.","wrong":null,"symbol":"create","correct":"import { create } from 'guzu'"}],"quickstart":{"code":"// Ensure you have a PostgreSQL instance running\n// Create a migration file\nimport { create, run } from 'guzu';\n\nawait create('add_users', { dsn: 'postgres://admin:password@localhost:5432', dir: './migrations' });\n\n// Apply pending migrations\nawait run({ dsn: 'postgres://admin:password@localhost:5432', dir: './migrations' });","lang":"typescript","description":"Demonstrates programmatic creation and application of migrations with guzu."},"warnings":[{"fix":"Use --force or redo command during development, or manually update the guzu_migrations table.","message":"Migration files are immutable once applied; hash mismatch prevents re-application.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Ensure every migration file starts with -- +guzu up.","message":"The -- +guzu up annotation is mandatory; missing it will cause migration to be ignored.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use -- +guzu NO TRANSACTION only if you understand the risks.","message":"Migrations run inside a transaction by default; disabling transactions may leave partial state.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Verify DSN format: postgres://username:password@host:port/database","message":"DSN must be a valid PostgreSQL connection string; no error message hints at format issues.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"N/A","message":"No known deprecations in v0.0.8.","severity":"deprecated","affected_versions":">=0.0.8"}],"env_vars":null,"search_vec":"'0.0.8':19 'activ':20 'built':35 'built-in':34 'check':39 'command':46 'configur':25 'current':16 'databas':62 'depend':60 'develop':21 'differenti':23 'enforc':10 'file':28 'goos':54 'guzu':1 'hash':14,37 'immut':11 'inspir':52 'integr':38 'javascript':61 'key':22 'manag':6 'migrat':5,12,27,48,63 'orm':33 'postgresql':8,57,64 'prevent':41 'requir':55 'seed':45 'sql':3,30,65 'sql-on':2,29 'tamper':42 'timestamp':26 'tool':51 'verif':15 'version':17 'zero':24","created_at":"2026-06-07T16:55:02.090542+00:00","updated_at":"2026-06-07T16:55:02.090542+00:00","problems":[{"fix":"Start PostgreSQL and verify DSN. Use localhost instead of ::1 if IPv6 is disabled.","cause":"PostgreSQL not running or wrong host.","error":"Error: connect ECONNREFUSED ::1:5432"},{"fix":"Create the migrations directory and add .sql files with -- +guzu up annotation.","cause":"Migrations directory does not exist or contains no .sql files.","error":"Error: no migration files found"},{"fix":"Add -- +guzu up at the top of the SQL file.","cause":"Missing required annotation in migration file.","error":"Error: migration file xxx.sql has no +guzu up annotation"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/garriguv/guzu","github":"https://github.com/garriguv/guzu","docs":null,"changelog":null,"pypi":null,"npm":"guzu","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}