Red — vars

Special Vars

$*RED-DB

This is the variable where Red stores the database connection.

use Red:api<2>;
my $*RED-DB = database "SQLite";

model Model {
    has Int $.id is id;
}

You should use red-do() and/or red-defaults() instead.

Each section below starts from a fresh copy of this setup. For the insert examples, run Model.^create-table before enabling the debug variable. Debug output goes to standard error; the excerpts show the relevant lines, and transaction or query traces may add more lines.

$*RED-DEBUG

When this variable is set to a true-ish value Red will print the generated SQLs to $*ERR.

my $*RED-DEBUG = True;
Model.^create-table;

Output excerpt

SQL : CREATE TABLE "model" (
   id integer NOT NULL primary key 
)
BIND: []

$*RED-DEBUG-RESPONSE

When this variable is set to a true-ish value Red will print the response from the SQL query to $*ERR.

my $*RED-DEBUG-RESPONSE = True;
Model.^create: :42id

Output excerpt

{id => 42}

$*RED-DEBUG-AST

When this variable is set to a true-ish value Red will print the generated AST to $*ERR.

my $*RED-DEBUG-AST = True;
Model.^create: :42id

Output excerpt

Red::AST::Insert:
    id

$*RED-COMMENT-SQL

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

$*RED-FALLBACK

Bool, defines if Red should fallback to original methods if the Red one has failed.

Red v0.2.17

A Raku ORM

Authors

  • Fernando Correa de Oliveira

License

Artistic-2.0

Dependencies

ConfigurationDBIishUUIDJSON::Fast

Test Dependencies

Provides

  • CX::Red::Bool
  • MetamodelX::Red::Comparate
  • MetamodelX::Red::Describable
  • MetamodelX::Red::Dirtable
  • MetamodelX::Red::GlobalNotifiable
  • MetamodelX::Red::Id
  • MetamodelX::Red::Migration
  • MetamodelX::Red::Model
  • MetamodelX::Red::OnDB
  • MetamodelX::Red::Populatable
  • MetamodelX::Red::PreFetch
  • MetamodelX::Red::Refreshable
  • MetamodelX::Red::Relationship
  • MetamodelX::Red::Specialisable
  • MetamodelX::Red::SubModelHOW
  • MetamodelX::Red::Supply
  • MetamodelX::Red::View
  • MetamodelX::Red::VirtualView
  • Red
  • Red::AST
  • Red::AST::AddForeignKeyOnTable
  • Red::AST::BeginTransaction
  • Red::AST::Between
  • Red::AST::BoundFilter
  • Red::AST::Case
  • Red::AST::Chained
  • Red::AST::ChangeColumn
  • Red::AST::Comment
  • Red::AST::CommitTransaction
  • Red::AST::Constraints
  • Red::AST::CreateColumn
  • Red::AST::CreateIndex
  • Red::AST::CreateTable
  • Red::AST::CreateView
  • Red::AST::DateTimeFuncs
  • Red::AST::Delete
  • Red::AST::Divisible
  • Red::AST::DriverExtension
  • Red::AST::DropColumn
  • Red::AST::Empty
  • Red::AST::Function
  • Red::AST::Generic::Infix
  • Red::AST::Generic::Postfix
  • Red::AST::Generic::Prefix
  • Red::AST::Infix
  • Red::AST::Infixes
  • Red::AST::Insert
  • Red::AST::Intersect
  • Red::AST::IsDefined
  • Red::AST::JsonItem
  • Red::AST::JsonOperation
  • Red::AST::JsonRemoveItem
  • Red::AST::JsonSetItem
  • Red::AST::LastInsertedRow
  • Red::AST::Minus
  • Red::AST::MultiSelect
  • Red::AST::Native
  • Red::AST::Next
  • Red::AST::Operator
  • Red::AST::Optimizer::AND
  • Red::AST::Optimizer::Case
  • Red::AST::Optimizer::OR
  • Red::AST::Ordering
  • Red::AST::ProductSource
  • Red::AST::ProjectionField
  • Red::AST::Reference
  • Red::AST::RegexCapture
  • Red::AST::RegexChars
  • Red::AST::RegexMatch
  • Red::AST::ReleaseSavepoint
  • Red::AST::RollbackToSavepoint
  • Red::AST::RollbackTransaction
  • Red::AST::RowContext
  • Red::AST::RowParameter
  • Red::AST::Savepoint
  • Red::AST::Select
  • Red::AST::StringFuncs
  • Red::AST::TableComment
  • Red::AST::Unary
  • Red::AST::Union
  • Red::AST::Update
  • Red::AST::Value
  • Red::Attr::Column
  • Red::Attr::Index
  • Red::Attr::Query
  • Red::Attr::Relationship
  • Red::Class
  • Red::Cli
  • Red::Cli::Column
  • Red::Cli::Relationship
  • Red::Cli::Table
  • Red::Column
  • Red::ColumnMethods
  • Red::Compiler::Emitter
  • Red::Compiler::RakuAST
  • Red::Compiler::Regex
  • Red::Compiler::Runtime
  • Red::Compiler::Template
  • Red::Config
  • Red::DB
  • Red::Database
  • Red::DefaultResultSeq
  • Red::Do
  • Red::Driver
  • Red::Driver::Cache
  • Red::Driver::Cache::Memory
  • Red::Driver::CacheInvalidateOnWrite
  • Red::Driver::CacheWithStrKey
  • Red::Driver::CommonSQL
  • Red::Driver::Events
  • Red::Driver::Migrations
  • Red::Driver::Mock
  • Red::Driver::SQLite
  • Red::Driver::SQLite::Regex
  • Red::Driver::SQLite::SQLiteMaster
  • Red::Driver::SQLite::SchemaReader
  • Red::Event
  • Red::Fixture
  • Red::Formatter
  • Red::Formatter::ResultSeq
  • Red::Formatter::ResultSeq::Vertical
  • Red::FromRelationship
  • Red::GlobalEvents
  • Red::HiddenFromSQLCommenting
  • Red::Index
  • Red::LockType
  • Red::Migration::Applied
  • Red::Migration::Artifact
  • Red::Migration::Bundle
  • Red::Migration::Column
  • Red::Migration::Configuration
  • Red::Migration::Data
  • Red::Migration::Dependencies
  • Red::Migration::Driver
  • Red::Migration::Environment
  • Red::Migration::File
  • Red::Migration::Import
  • Red::Migration::Logical
  • Red::Migration::Manager
  • Red::Migration::Migration
  • Red::Migration::Planner
  • Red::Migration::Resolution
  • Red::Migration::SQL
  • Red::Migration::Scripts
  • Red::Migration::Snapshot
  • Red::Migration::Storage
  • Red::Migration::Table
  • Red::Migration::Test
  • Red::Model
  • Red::Operators
  • Red::Phaser
  • Red::PrepareCode
  • Red::Projection
  • Red::QueryPlan
  • Red::QueryPlan::Cache
  • Red::Regex
  • Red::Regex::Automaton
  • Red::Regex::Unicode
  • Red::ResultAssociative
  • Red::ResultSeq
  • Red::ResultSeq::Iterator
  • Red::ResultSeq::Supply
  • Red::ResultSeqMethods
  • Red::ResultSeqSeq
  • Red::RowSecurity
  • Red::RowSecurity::Context
  • Red::RowSecurity::DDL
  • Red::RowSecurity::PostgreSQL
  • Red::RowSecurity::Statement
  • Red::RowSecurity::Write
  • Red::Runtime::Configuration
  • Red::Schema
  • Red::SchemaReader
  • Red::Statement
  • Red::Traits
  • Red::Transaction::Guard
  • Red::Type
  • Red::Type::Json
  • Red::Type::Map
  • Red::Utils
  • X::Red::Exceptions
  • X::Red::Migration

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.