Pass dynamic database to liquibase property - liquibase

My Liquibase property file looks like this
driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
classpath: C:\\Program Files\\sqljdbc_10.2\\enu\\mssql-jdbc-10.2.1.jre17.jar
changeLogFile: .\\home_changeLog.xml
url: jdbc:sqlserver://localhost;databaseName=home;integratedSecurity=false;trustServerCertificate=true;
username: user
password: password123
liquibase.hub.mode=off
I wanted to parametrise the database name used in the URL, tried by changing the URL to
url: jdbc:sqlserver://localhost;databaseName=${database};integratedSecurity=false;trustServerCertificate=true;
when I execute
liquibase --defaults-file="Home.properties" updatesql -database="home2"
Liquibase raise the error below
Unexpected error running Liquibase: Connection could not be created to
jdbc:sqlserver://localhost;databaseName=${database};integratedSecurity=false;trustServerCertificate=true;
with driver com.microsoft.sqlserver.jdbc.SQLServerDriver. The
connection string contains a badly formed name or value.
If I execute
liquibase --defaults-file="Home.properties" updatesql --database="home2"
Unexpected argument(s): --database=home2
How can I parametrise the database name used in the URL? I would like to use the change log file rather than using different change log files for each environment.
Thanks

Related

dbt: could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS

I'm trying to connect dbt to BigQuery in vscode. For that I extracted a bigquery keyfile json that I put into the root directory of my dbt project.
I then created a profiles.yml file that looks as follows:
my-bigquery-db:
target: dev
outputs:
dev:
type: bigquery
method: service-account
project: civil-parsec-350114
dataset: dbt_dataset
threads: 1
keyfile: bigquery.json
Database Error
Runtime Error
dbt encountered an error while trying to read your profiles.yml file.
Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application. For more information, please see https://cloud.google.com/docs/authentication/getting-started
When I put an empty projects.yml file I get the same error, so I'm not even sure if that file is loaded at all. How can I best debug this? What could be the problem?

Change error output format of ansible-molecule test/converge

This is a follow up question of:
Clean error output in ansible-playbook
The above post proposed a way to change the output format of ansible-playbook once it encounter an error. But I found that it is largely ineffective for ansible-molecule (https://molecule.readthedocs.io/en/latest/index.html). When I run the test suite:
$ molecule converge
It still generates the error message with lots of escaped characters:
...
TASK [solo : copy wifi.sh] *****************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: #bash /tmp/setupwifi.sh > /log/setupwifi.log 2>&1
fatal: [instance]: FAILED! => {"changed": false, "msg": "AnsibleError: template error while templating string: unexpected char '#' at 1526. String: \ncat > /tmp/timeout.sh << 'SCRIPT'\n#!/bin/sh\n\n# Execute a command with a timeout\n\n# License: LGPLv2\n# Author:\n# http://www.pixelbeat.org/\n# Notes:\n# Note there is a timeout command packaged with coreutils since v7.0\n# ...
It may be possible that ansible-molecule fail to identify ansible.cfg file under the directory. How should I configure it properly in my testing?
Quick and dirty background info (dig into the doc to find more info if you want extra details): molecule does not read your ansible.cfg at role level but will reconstruct its own config file in molecule/<scenario_dir>/.molecule/ansible.cfg.
You cannot change everything in that file (and certainly not edit it yourself manually), but there are quite a few config options you can set in the provisionner.config_options section of your molecule.yml file. I did not check specifically but I believe that changing the stdout_callback and stderr_callback should be possible. This is described in the configuration page in documentation. Give it a try:
provisionner:
name: ansible
config_options:
defaults:
stdout_callback: debug
stderr_callback: debug

SQL Loader Unix - Giving error SQL Loader-500 Unable to open file (ABC_CTL.dat)

We are executing SQL loader command from shell script on RH Linux OS. The command passes both control file and data file as command line parameters. The syntax used is given below (masked sensitive data):
sqlldr userid=$connstring control=/local/abc-1.2.3/instances/www.abc.com/apps/int/script/bin/ABC_CONTROL.ctl data=$f log=/local/abc-1.2.3/instances/www.abc.com/apps/int/script/logs/ABC.log bad=/local/abc-1.2.3/instances/www.abc.com/apps/int/script/logs/ABC.bad
The data file name is passed as dynamic variable in a FOR loop to process multiple files. The data file extension is *.app and path is /local/abc-1.2.3/instances/www.abc.com/apps/int/script/input.
We have verified that $f variable is able to correctly point to data file. Also verified file permissions. We tried changing the directory paths as well.
Still script fails with below error: **SQL Loader-500 Unable to open file (ABC_CTL.dat)**, SQL Loader-553 File not found, SQL Loader-509 System error: No such file or directory
The same script runs with exact same syntax on another server. Please suggest any solutions.

Beeline CLI create txt file command?

I recently have started to use Beelines CLI to interface with a hive server.
The problem is that create file command is failing for me.
I have tried the following:
add FILE[S] 'example.txt';
Which returns this error:
Error: Error while processing statement: null (state=,code=1)
You should remove the quotes from the path. i.e.
beeline> add file example.txt;
Also be sure that you are only adding files to the server hive is running on.

Can not connect to Db- Dump using codeception

I am struggling to use the db functionality of codeception framework. The error i am getting is
Db: could not find mysql driver while creating PDO connection
actor: AcceptanceTester
modules:
enabled: [Db, PhpBrowser]
config:
Db:
dsn: "mysql:host=localhost;dbname=my_db"
user: 'root'
password:
populate: true
cleanup: true
dump: 'tests/_data/Dump20180423.sql'
PhpBrowser:
url :
My acceptance.suite.yaml file is set like this.
Also my dump file has the CREATE TABLE command inside.
The path for Mysql is already set in the environmental variables path.
The pdo extensions are set inside my php.ini file
I guess it's a problem with the dsn as it fails before validating my user credentials. Also my mysql works fine. I have projects that i use PDO connection and they work without any issue.
I tried every solution i could find but still getting the same error. Thank you in advance for any help!!!
So after many hours/days i finally found out the solution to this. The problem was coming from my cygwin (linux console). While my php.ini file was fine and php info was sawing i had pdo_mysql installed and everything seemed like that, cygwin had a different opinion. I had to install pdo_mysql inside cygwin so the command :
php vendor/bin/codecept run could connect to the database and work!!!
Typing php -m in my cygwin console showed me that i was missing this module (pdo_mysql).
After that the problem is solved and my tests work fine.