Closed jackall3n closed 1 year ago
Solves #15 #16 #39 #43
Hey @rap2hpoutre, what are your thoughts on this?
@rap2hpoutre I've added another --silent
option as it'll help with the output to stdout (-o -
)
@rap2hpoutre If you get a chance to review this that would be great. If I don't hear from you in the next day or so, I'll just release this to a new package
Thank you so much for your contribution 🎉 and sorry for the super late answer. I just reviewed it, I accept all your changes, and I will release it soon! (I have to remember how to release this package though !)
:tada: This PR is included in version 0.8.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Hey @rap2hpoutre,
I've upgraded
oclif
to the latest version, now using@oclif/core
which has better type safety and error handling. In addition to this I've added in unit tests (as it was listed as an enhancement #15).pg-anonymizer
changes--list
has been renamed to--columns
(-c
) as it feels more obvious. I've added--list
(-l
) as an alias with a deprecation warning so that people can still use it if they want.--configFile
has changed to--config
as it was the only argument written as camelcase. I've added--configFile
as an alias with a deprecation warning as well.--extension
has changed to--transformer
as I've created a new format that users are able to do to transform columns (and entire rows! #39). I've added--extension
as an alias with a deprecation warning as well.--pgDumpOutputMemory
has an official deprecated warning now.--verbose
has been added which logs extra information out for debugging.--silent
has been added to remove silence all logging from the cli-o/--output
is set to-
, logs are prepended with--
so that the output can be treated as.sql
and piped into other commands.Error handling with
CLIError
CLIError
from@oclif/errors
has been introduced to improve error handling in following scenarios:--transformer
file:--transformer ~/something/not/real
--columns name:transformer.notAFunction
faker
replacement has been specified that does not exist:--columns name:faker.not.real
pg_dump
returns an error.Testing
Tests have been added using
@oclif/test
. They run against a local database referenced in theDATABASE_URL
environment variable.I've added
prisma
to the project. I've set it up to create the database schema and seed the database with values to test against. I've created a.github/workflows/test.yml
that runspostgres
, configures the database usingyarn db:setup
and runsyarn test
.At the moment the tests cover:
--columns
(with and without replacements)--skip
--preserve-null
--silent
--output
(partially)PGARGS