-
-
Notifications
You must be signed in to change notification settings - Fork 27
Dynamic Variables
Juan Julián Merelo Guervós edited this page Sep 7, 2019
·
9 revisions
This is the variable where Red stores the database connection.
use Red;
my $*RED-DB = database "SQLite";
Its usage will be substituted for red-do()
and/or red-defaults()
When this variable is set to a true-ish value Red will print the generated SQL
s to $*OUT
.
my $*RED-DEBUG = True;
Model.^create-table;
Output
SQL : CREATE TABLE model(
id integer NOT NULL primary key
)
BIND: []
When this variable is set to a true-ish value Red will print the response from the SQL query to $*OUT
.
my $*RED-DEBUG-RESPONSE = True;
Model.^create: :42id
Output
{id => 42}
When this variable is set to a true-ish value Red will print the generated AST
to $*OUT
.
my $*RED-DEBUG-AST = True;
Model.^create: :42id
Output
Red::AST::Insert:
id
When this variable is set to a true-ish value Red will add comments about where in the code it was called on the SQL query
.
my $*RED-COMMENT-SQL = True;
Model.^create: :42id