Red
Red copied to clipboard
$*RED-DB wasn't defined when red-defaults is present in sub package
Let's say I have a module like App::Example::Schema, which contains my red-defaults like so:
red-defaults
"Pg",
host => "localhost",
database => "example",
user => "example",
password => "password",
:default,
;
And then I have my main script trying to call it like this:
use App::Example::Schema;
MyModel.^create-table: :if-not-exists;
We still get the $*RED-DB wasn't defined error.
Hi, i had the same problem ( within Cro ) and ended using
$GLOBAL::RED-DB = database "SQLite", :database( "db.sql" );
maybe this will help
@Demayl unfortunately I have the same issue when using your method, but I appreciate the suggestion. :)
@kawaii I've added a test for it (https://github.com/FCO/Red/commit/d0085007ff75e3eb35e1f334b24b5ee6165a6926). Is it still broken for you?