{"body":"raku -I. -MRed -e '\n\nmodel Person {...}\n\nmodel Post is rw {\n    has Int         $.id        is serial;\n    has Int         $!author-id is referencing( *.id, :model<Person> );\n    has Str         $.title     is column{ :unique };\n    has Str         $.body      is column;\n    has Person      $.author    is relationship{ .author-id };\n    has Bool        $.deleted   is column = False;\n    has DateTime    $.created   is column .= now;\n    has Set         $.tags      is column{\n        :type<string>,\n        :deflate{ .keys.join: \",\" },\n        :inflate{ set(.split: \",\") }\n    } = set();\n    method delete { $!deleted = True; self.^save }\n}\n\nmodel Person is rw {\n    has Int  $.id            is serial;\n    has Str  $.name          is column;\n    has Post @.posts         is relationship{ .author-id };\n    method active-posts { @!posts.grep: not *.deleted }\n}\n\nmy $*RED-DEBUG = True;\nmy $*RED-DB = database(\"SQLite\");\n\nsay \"✓ Creating tables for Person and Post\";\nPerson.^create-table;\nPost.^create-table;\n\nsay \"✓ Creating a Person\";\nmy $p  = Person.^create: :name<Fernando>;\n\n$p.posts.create: :title<Bla>, :body<Ble>;\n\n.say for Post.^all\n\n'\n✓ Creating tables for Person and Post\nSQL : CREATE TABLE person(\n   id integer NOT NULL primary key AUTOINCREMENT,\n   name varchar(255) NOT NULL \n)\nBIND: []\nSQL : CREATE TABLE post(\n   id integer NOT NULL primary key AUTOINCREMENT,\n   author_id integer NULL references person(id),\n   title varchar(255) NOT NULL ,\n   body varchar(255) NOT NULL ,\n   deleted integer NOT NULL ,\n   created varchar(255) NOT NULL ,\n   tags varchar(255) NOT NULL ,\n   UNIQUE (title)\n)\nBIND: []\n✓ Creating a Person\nSQL : INSERT INTO person(\n   name\n)\nVALUES(\n   ?\n)\nBIND: [\"Fernando\"]\nSQL : SELECT\n   person.id , person.name \nFROM\n   person\nWHERE\n   _rowid_ = last_insert_rowid()\nLIMIT 1\nBIND: []\nSQL : SELECT\n   person.id , person.name \nFROM\n   person\nWHERE\n   person.id = 1\nLIMIT 1\nBIND: []\nSQL : INSERT INTO post(\n   created,\n   body,\n   title,\n   author_id,\n   tags,\n   deleted\n)\nVALUES(\n   ?,\n   ?,\n   ?,\n   ?,\n   ?,\n   ?\n)\nBIND: [\"2020-01-16T14:44:38.448989Z\", \"Ble\", \"Bla\", 1, \"\", Bool::False]\nSQL : SELECT\n   post.id , post.author_id as \"author-id\", post.title , post.body , post.deleted , post.created , post.tags \nFROM\n   post\nWHERE\n   _rowid_ = last_insert_rowid()\nLIMIT 1\nBIND: []\nSQL : SELECT\n   post.id , post.author_id as \"author-id\", post.title , post.body , post.deleted , post.created , post.tags \nFROM\n   post\nWHERE\n   post.id = 1\nLIMIT 1\nBIND: []\nSQL : SELECT\n   post.id , post.author_id as \"author-id\", post.title , post.body , post.deleted , post.created , post.tags \nFROM\n   post\nBIND: []\nPost.new(id => 1, title => \"Bla\", body => \"Ble\", deleted => Bool::False, created => DateTime.new(2020,1,16,14,44,38.448989), tags => Set.new(\"\"))","name":"","extension":"txt","url":"https://www.irccloud.com/pastebin/TROJKDjA","modified":1579185948,"id":"TROJKDjA","size":2788,"lines":122,"own_paste":false,"theme":"","date":1579185948}