BossDB and Postgres

40 views
Skip to first unread message

Ángel Herranz

unread,
Jan 22, 2016, 7:06:22 AM1/22/16
to ChicagoBoss
Hi,

I am trying to migrate the postgres adapter to the current epgsql driver version 3.1.1 (https://github.com/epgsql/epgsql/tree/3.1.1, https://groups.google.com/forum/#!topic/epgsql/Tx8Fhis1VNU) with the idea of using boss_db as data access layer of a non CB project.

After several changes (https://github.com/aherranz/boss_db/commits/migrating_to_epgsql_3) I was not able to run the tests on the new driver.

Then I tries to run the tests on the old adapter and I got the same error (I needed to comment mongo and riak in the rebar test configuration file):

angel@Lenovo-X301: /boss_db.aherranz ((7dfa040...))$ make test_db_pgsql
WARN:  Ignoring sub_dirs for /
home/angel/Coowry/boss_db.aherranz/deps/ddb
==> boss_db.aherranz (clean)
WARN
:  Ignoring sub_dirs for /home/angel/Coowry/boss_db.aherranz/deps/ddb
==> boss_db.aherranz (compile)
Compiled src/boss_cache_adapter.erl
...
Compiled src/boss_record.erl
erl
-pa ebin -pa deps/*/ebin -run boss_db_test start -config priv/test_db_config/pgsql -noshell
{"init
 terminating in
do_boot",{function_clause,[{boss_db_controller,db_for_type,[boss_db_test_parent_model,db_connection_down],[{file,"src/boss_db_controller.erl"},{line,416}]},{boss_db_controller,handle_call,3,[{file,"src/boss_db_controller.erl"},{line,161}]},{boss_db,db_call,2,[{file,"src/boss_db.erl"},{line,105}]},{boss_db,save_record,2,[{file,"src/boss_db.erl"},{line,421}]},{boss_db_test_app,'-run_tests_inner/0-fun-1-',0,[{file,"src/boss_db_test_app.erl"},{line,67}]},{boss_db_test_app,do,3,[{file,"src/boss_db_test_app.erl"},{line,233}]},{boss_db,mock_transaction,1,[{file,"src/boss_db.erl"},{line,387}]},{boss_db_test_app,start,2,[{file,"src/boss_db_test_app.erl"},{line,12}]}]}}

Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
make: *** [test_db_pgsql] Error 1
angel@Lenovo-X301: /boss_db.aherranz ((7dfa040...))$


I have configured postgres in my localhost according to the configuration file priv/test_db_config/pgsql.config:

[{boss_db,
   
[
   
{db_adapter, pgsql},
   
{db_host, "localhost"},
   
{db_port, 5432},
   
{db_database, "boss_test"},
   
{db_username, "boss_test"},
   
{db_password, "testpass"}
   
]
}].

I have also tried to debug the problem but I am not experience enough. Nevertheless I suspect that the options are not loaded from that file.

How can I run the tests in order to check that migration is going in the right direction?

Regards.

Reply all
Reply to author
Forward
0 new messages