Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for release of v0.1.3 #174

Merged
merged 2 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright Marcelo Zabani (c) 2023
Copyright Marcelo Zabani (c) 2024

All rights reserved.

Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@

# What is Codd?

Codd is a CLI tool that applies plain SQL migrations atomically (when PostgreSQL allows it) and includes automatic schema equality checks that
go from table columns' names and types, to table privileges up to row security policies, database encoding [and more](/docs/DATABASE-EQUALITY.md). No JSON, XML or YAML, just SQL.
No writing code to ensure schemas in different environments are the same, that's done automatically.
Codd is a CLI tool that applies plain SQL migrations atomically (when PostgreSQL allows it) and includes schema equality checks that practically ensure your development database's schema matches the database schema in every other environment,
checking table columns' names, types, order, available functions, roles, table privileges, object ownership, row security policies, database encoding [and much more](/docs/DATABASE-EQUALITY.md).
These schema equality checks happen automatically; you only need to write .sql files and `codd add migration-file.sql` them. No configuration files, JSON, or YAML; just 3 environment variables and .sql files and you can use codd.

It's also meant to be really simple to use: codd reads SQL files from folders you choose and applies migrations in order. Any special features
for these migrations are typically special top-level comments in those SQL files, but you won't need them most of the time. Setting your environment up to use codd from scratch [takes 15 minutes](#get-codd-up-and-running-in-15-minutes).
It's also meant to be really simple to use: codd reads SQL files from folders you choose and applies migrations in order. Any special features for these migrations are typically special top-level comments in those SQL files, but you won't need them most of the time. Setting your environment up to use codd from scratch [takes 15 minutes](#get-codd-up-and-running-in-15-minutes).

In day to day usage, you will typically run `codd add new-migration.sql` and/or `codd up`, and very likely no other commands.

Compared to other DB tools, codd aims for simplicity and strong automatic schema equality checks, meaning it doesn't have all the features other
tools do. It also only supports PostgreSQL.
Compared to other DB tools, codd aims for simplicity and strong automatic schema equality checks, meaning it doesn't have all the features other tools do. It also only supports PostgreSQL.

Here you can see its main features in more detail:

Expand Down
5 changes: 3 additions & 2 deletions codd.cabal
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
cabal-version: 2.0

name: codd
version: 0.1.2
version: 0.1.3
description: Multi-environment postgres database version control. README at <https://github.com/mzabani/codd#readme>
homepage: https://github.com/mzabani/codd#readme
bug-reports: https://github.com/mzabani/codd/issues
author: Marcelo Zabani
maintainer: [email protected]
copyright: 2022 Marcelo Zabani
copyright: 2024 Marcelo Zabani
license: BSD3
license-file: LICENSE
build-type: Simple
Expand Down Expand Up @@ -237,6 +237,7 @@ test-suite codd-test
GeneralizedNewtypeDeriving
MultiParamTypeClasses
NamedFieldPuns
NumericUnderscores
OverloadedStrings
RankNTypes
RecordWildCards
Expand Down
2 changes: 1 addition & 1 deletion nix/install-codd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ then
fi

SRCDIR=$(mktemp -d || echo /tmp/codd-checkout-Y6fRwa_23x)
git clone --depth 1 -b v0.1.2 https://github.com/mzabani/codd.git "$SRCDIR"
git clone --depth 1 -b v0.1.3 https://github.com/mzabani/codd.git "$SRCDIR"

nix-env -f "$SRCDIR/nix/install-codd-nixpkgs.nix" \
--option trusted-substituters 'https://cache.nixos.org https://cache.iog.io https://mzabani.cachix.org' \
Expand Down
3 changes: 3 additions & 0 deletions test/SystemResourcesSpecs/OpenFilesSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Codd ( VerifySchemas(..)
)
import Codd.Environment ( CoddSettings(..) )
import Control.Applicative ( (<|>) )
import Control.Concurrent ( threadDelay )
import Control.Monad ( foldM
, forM_
, void
Expand Down Expand Up @@ -44,6 +45,8 @@ spec = do
LaxCheck -- This will output an error but will not throw. What matters is that on-disk reps are read
-- This test must run wrapped in a specific strace incantation as it'll read the output log of that
-- to assert that at most one migration file is opened at a time
-- It seems it's possible for the writes of strace to not have been flushed yet, so wait a second just in case.
threadDelay 1_000_000
contentsE <-
try $ Text.readFile
"/tmp/strace-codd-system-resources-test.log"
Expand Down
Loading