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

DAT-17582 Liquibase NPM default connection- edit summary Liquibase NPM default connection #104

Merged
merged 3 commits into from
Jun 20, 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
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,10 @@ node-liquibase /Users/me/path/to/my/executable/for/liquibase
import {
LiquibaseConfig,
Liquibase,
POSTGRESQL_DEFAULT_CONFIG,
} from 'liquibase';

const myConfig: LiquibaseConfig = {
...POSTGRESQL_DEFAULT_CONFIG,
changeLogFile: './changelog.xml',
url: 'jdbc:postgresql://localhost:5432/node_liquibase_testing',
username: 'yourusername',
password: 'yoursecurepassword',
Expand All @@ -134,10 +133,8 @@ doEet();

```js
const Liquibase = require('liquibase').Liquibase;
const POSTGRESQL_DEFAULT_CONFIG = require('liquibase').POSTGRESQL_DEFAULT_CONFIG;

const myConfig = {
...POSTGRESQL_DEFAULT_CONFIG,
changeLogFile: './changelog.xml',
url: 'jdbc:postgresql://localhost:5432/node_liquibase_testing',
username: 'yourusername',
Expand Down Expand Up @@ -242,7 +239,6 @@ Using the `liquibase` property on your config object.
import { Liquibase, LiquibaseConfig, POSTGRESQL_DEFAULT_CONFIG } from 'liquibase';

const myConfig: LiquibaseConfig = {
...POSTGRESQL_DEFAULT_CONFIG,
changeLogFile: './changelog.xml',
url: 'jdbc:postgresql://localhost:5432/node_liquibase_testing',
username: 'yourusername',
Expand All @@ -258,7 +254,6 @@ inst.status();
import { Liquibase, LiquibaseConfig, POSTGRESQL_DEFAULT_CONFIG } from 'liquibase';

const myConfig: LiquibaseConfig = {
...POSTGRESQL_DEFAULT_CONFIG,
changeLogFile: './changelog.xml',
url: 'jdbc:postgresql://localhost:5432/node_liquibase_testing',
username: 'yourusername',
Expand Down
16 changes: 0 additions & 16 deletions src/liquibase.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env node
// import { join } from 'path';
import { CommandHandler, FileHelper } from './util';
import { POSTGRESQL_DEFAULT_CONFIG } from './constants/defaults/postgresql-default.config';
import { LiquibaseCommands } from './enums/liquibase-commands.enum';
import {
LiquibaseConfig,
Expand Down Expand Up @@ -90,7 +89,6 @@ export class Liquibase {
* ```
*/
constructor(private config: LiquibaseConfig) {
this.mergeConfigWithDefaults(config);
this.commandHandler = new CommandHandler(this.config);
}

Expand Down Expand Up @@ -922,20 +920,6 @@ export class Liquibase {
return this.commandHandler.spawnChildProcess(commandString);
}

/**
* For now, we will assume Postgres is the 'default' database type.
* In the future we can be smarter about how we merge these configs.
*
* @param config User Provided `LiquibaseConfig`
*/
private mergeConfigWithDefaults(config: LiquibaseConfig) {
const defaults: LiquibaseConfig = {
...POSTGRESQL_DEFAULT_CONFIG,
liquibase: FileHelper.bundledLiquibasePath,
};
this.config = Object.assign({}, defaults, config);
}

/**
* LEGACY CODE END
**/
Expand Down
Loading