Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create table with the same columns order as model's attributes order #135

Closed
FCO opened this issue Mar 18, 2019 · 38 comments
Closed

Create table with the same columns order as model's attributes order #135

FCO opened this issue Mar 18, 2019 · 38 comments
Labels
enhancement New feature or request
Projects

Comments

@FCO
Copy link
Owner

FCO commented Mar 18, 2019

No description provided.

@jonathanstowe
Copy link
Contributor

You beat me to it. I actually noticed this the other day.

@FCO
Copy link
Owner Author

FCO commented Mar 18, 2019

I don't know why I thought it was a good idea to use a Set to store the columns... :P

@jonathanstowe
Copy link
Contributor

Because you could 😎😂

@FCO FCO added the enhancement New feature or request label Mar 18, 2019
@FCO FCO closed this as completed Mar 21, 2019
@FCO FCO added this to backlog in Documenting Mar 27, 2019
@bazzaar
Copy link

bazzaar commented Apr 8, 2019

I was just going to add a new issue reporting the column order thing, till I saw this. I used the code in the FCO/Red README, to create the Person/Post tables in Pg. Glad it's being addressed. Thanks for your efforts.

@FCO
Copy link
Owner Author

FCO commented Apr 8, 2019

@bazzaar sorry, I haven't gotten it... Are you still having this problem? With the GitHub code? Should I reopen this issue?

Thanks for your report!

@bazzaar
Copy link

bazzaar commented Apr 8, 2019

@FCO it might be my installed Red module is not completely up to date (used with the latest Rakudo Star), I guess I should see if I can get the latest code and use that. Probably my mistake. Though yes I did find the order of columns mixed up in my resulting tables.

bazzaar=> \d post
                                        Table "public.post"
  Column   |            Type             | Collation | Nullable |             Default              
-----------+-----------------------------+-----------+----------+----------------------------------
 body      | character varying(255)      |           | not null | 
 author_id | integer                     |           |          | 
 deleted   | boolean                     |           | not null | 
 tags      | character varying(255)      |           | not null | 
 title     | character varying(255)      |           | not null | 
 id        | integer                     |           | not null | nextval('post_id_seq'::regclass)
 created   | timestamp without time zone |           | not null | 
Indexes:
    "post_pkey" PRIMARY KEY, btree (id)
    "post_title_key" UNIQUE CONSTRAINT, btree (title)
Foreign-key constraints:
    "post_author_id_fkey" FOREIGN KEY (author_id) REFERENCES person(id)

bazzaar=> select * from post;
 body | author_id | deleted | tags | title | id | created 
------+-----------+---------+------+-------+----+---------
(0 rows)

@FCO
Copy link
Owner Author

FCO commented Apr 8, 2019

@bazzaar installed with zef? Not from GitHub? This change aren't on the CPAN yet... but if you clone the repo and zef install --force-install . to install the repo version, it might work. :)

@bazzaar
Copy link

bazzaar commented Apr 8, 2019

@FCO thanks for the helpful tip, I didn't know how to install a local module, but now I do :-)

... however, unfortunately the install failed :

bazzaar@linux-box:~/git_projects/Red> zef install --force-install .
===> Testing: Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Testing [OK] for Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Installing: Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Install [FAIL] for Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>: ===SORRY!===
Function 'X::Red::Driver::Mapped::TableExists' needs parens to avoid gobbling block (or perhaps it's a class that's not declared or available in this scope?)
at /home/bazzaar/git_projects/Red/site#sources/D10D41AB1ED8F1B8E05FB2205140E2E2710D3419 (MetamodelX::Red::Model):234
------>     }⏏}
Missing block (apparently claimed by 'X::Red::Driver::Mapped::TableExists')
at /home/bazzaar/git_projects/Red/site#sources/D10D41AB1ED8F1B8E05FB2205140E2E2710D3419 (MetamodelX::Red::Model):234
------>     }⏏}


===SORRY!===
Function 'X::Red::Driver::Mapped::TableExists' needs parens to avoid gobbling block (or perhaps it's a class that's not declared or available in this scope?)
at /home/bazzaar/git_projects/Red/site#sources/D10D41AB1ED8F1B8E05FB2205140E2E2710D3419 (MetamodelX::Red::Model):234
------>     }⏏}
Missing block (apparently claimed by 'X::Red::Driver::Mapped::TableExists')
at /home/bazzaar/git_projects/Red/site#sources/D10D41AB1ED8F1B8E05FB2205140E2E2710D3419 (MetamodelX::Red::Model):234
------>     }⏏}

@FCO
Copy link
Owner Author

FCO commented Apr 8, 2019

odd, it installed here:

$ zef install --force-install .
===> Testing: Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Testing [OK] for Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Installing: Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
$ perl6 -v
This is Rakudo version 2018.12-304-geb8561ba1 built on MoarVM version 2018.12-94-g2eab275df
implementing Perl 6.d.

@bazzaar
Copy link

bazzaar commented Apr 8, 2019

bazzaar@linux-box: .... /git_projects/Red> git status
On branch master
Your branch is up to date with 'origin/master'. # <----- a fork of FCO/Red, but Github says it's 'even'
nothing to commit, working tree clean
bazzaar@linux-box: .... /git_projects/Red> perl6 -v
This is Rakudo Star version 2019.03.1 built on MoarVM version 2019.03
implementing Perl 6.d.

@bazzaar
Copy link

bazzaar commented Apr 8, 2019

in Red/lib/X/Red/Exceptions.pm6
it might be that a newline is needed on the last line of the file, to complete the
class X::Red::Driver::Mapped::TableExists codeblock ?

.... But now that's thrown up the following :

bazzaar@linux-box:~/git_projects/Red> zef install --force-install .
===> Testing: Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Testing [OK] for Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Installing: Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Install [FAIL] for Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>: 
===SORRY!=== Error while compiling /home/bazzaar/git_projects/Red/site#sources/A2B88934DAD40D45031A63C4FD64D8674E76283D (Red::Operators)
Invalid typename 'Red::AST::In' in parameter declaration.
at /home/bazzaar/git_projects/Red/site#sources/A2B88934DAD40D45031A63C4FD64D8674E76283D (Red::Operators):411
------> multi prefix:<not>(Red::AST::In⏏ $a) is export {

===SORRY!=== Error while compiling /home/barry/git_work/Red/site#sources/A2B88934DAD40D45031A63C4FD64D8674E76283D (Red::Operators)
Invalid typename 'Red::AST::In' in parameter declaration.
at /home/bazzaar/git_projects/Red/site#sources/A2B88934DAD40D45031A63C4FD64D8674E76283D (Red::Operators):411
------> multi prefix:<not>(Red::AST::In⏏ $a) is export {

@FCO
Copy link
Owner Author

FCO commented Apr 8, 2019

I've updated my perl6 version and I'm getting:

$ zef install --force-install .
===> Testing: Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Testing [OK] for Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Installing: Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
Out-of-sync package detected in LANG1 at s $.op = "%%";
has Bool $.retu
  (value in braid: Red::AST::Divisable, value in $*PACKAGE: Red::AST::Divisable)
$ perl6 -v
This is Rakudo version 2019.03.1-168-ga9b9cdc9f built on MoarVM version 2019.03-61-g645a70c0d
implementing Perl 6.d.

@bazzaar
Copy link

bazzaar commented Apr 8, 2019

in Red/Operators.pm6 : perhaps these two 'infix creator' blocks are repeated, the 2nd occurrence of which have Red::AST::In which is perhaps incorrect

Lines 411-417 :

multi prefix:<not>(Red::AST::In $a) is export {
    $a.not;
}

multi prefix:<!>(Red::AST::In $a) is export {
    $a.not;
}

@FCO
Copy link
Owner Author

FCO commented Apr 8, 2019

When I tried for the 2nd time it haven't gave me any warning or error...

@FCO
Copy link
Owner Author

FCO commented Apr 8, 2019

It's working therefor me... @jonathanstowe would you mind to test it?

@FCO
Copy link
Owner Author

FCO commented Apr 8, 2019

@bazzaar
Copy link

bazzaar commented Apr 8, 2019

So I commented out the lines 411-417 in Red/Operators.pm6, and that error disappeared, but now I'm back to the original error again (that's with my edit to add a new line to the end of Red/lib/X/Red/Exceptions.pm6)

bazzaar@linux-box:~/git_projects/Red> zef install --force-install .
===> Testing: Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Testing [OK] for Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Installing: Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Install [FAIL] for Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>: ===SORRY!===
Function 'X::Red::Driver::Mapped::TableExists' needs parens to avoid gobbling block (or perhaps it's a class that's not declared or available in this scope?)
at /home/bazzaar/git_projects/Red/site#sources/D10D41AB1ED8F1B8E05FB2205140E2E2710D3419 (MetamodelX::Red::Model):234
------>     }⏏}
Missing block (apparently claimed by 'X::Red::Driver::Mapped::TableExists')
at /home/bazzaar/git_projects/Red/site#sources/D10D41AB1ED8F1B8E05FB2205140E2E2710D3419 (MetamodelX::Red::Model):234
------>     }⏏}

===SORRY!===
Function 'X::Red::Driver::Mapped::TableExists' needs parens to avoid gobbling block (or perhaps it's a class that's not declared or available in this scope?)
at /home/bazzaar/git_projects/Red/site#sources/D10D41AB1ED8F1B8E05FB2205140E2E2710D3419 (MetamodelX::Red::Model):234
------>     }⏏}
Missing block (apparently claimed by 'X::Red::Driver::Mapped::TableExists')
at /home/bazzaar/git_projects/Red/site#sources/D10D41AB1ED8F1B8E05FB2205140E2E2710D3419 (MetamodelX::Red::Model):234
------>     }⏏}

The zef install seemed to take quite a bit longer before it failed though ...

@FCO
Copy link
Owner Author

FCO commented Apr 8, 2019

The last Rakudo version, with no changes it's working...
https://travis-ci.org/FCO/Red/jobs/516639618#L1521

@FCO
Copy link
Owner Author

FCO commented Apr 8, 2019

@bazzaar would you mind to send me the output of a git diff please?

@bazzaar
Copy link

bazzaar commented Apr 8, 2019

I also tried adding stubs for two infix classes In and NotIn but it didn't make a difference, same error. Here's the git diff output :

diff --git a/lib/Red/AST/Infixes.pm6 b/lib/Red/AST/Infixes.pm6                                                                                                                                                                                                                 
index 8bd60cf..3a7276b 100644                                                                                                                                                                                                                                                  
--- a/lib/Red/AST/Infixes.pm6                                                                                                                                                                                                                                                  
+++ b/lib/Red/AST/Infixes.pm6                                                                                                                                                                                                                                                  
@@ -13,9 +13,6 @@ class Red::AST::Div     { ... }                                                                                                                                                                                                                              
 class Red::AST::Mod     { ... }                                                                                                                                                                                                                                               
 class Red::AST::Concat  { ... }                                                                                                                                                                                                                                               
 class Red::AST::Like    { ... }                                                                                                                                                                                                                                               
-class Red::AST::NotIn   { ... }  # added this, bazzaar                                                                                                                                                                                                                        
-class Red::AST::In      { ... }  # added this, bazzaar                                                                                                                                                                                                                        
-                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                               
 class Red::AST::Eq does Red::AST::Infix {                                                                                                                                                                                                                                     
     has $.op = "=";                                                                                                                                                                                                                                                           
diff --git a/lib/Red/Operators.pm6 b/lib/Red/Operators.pm6                                                                                                                                                                                                                     
index d78f26e..5394395 100644                                                                                                                                                                                                                                                  
--- a/lib/Red/Operators.pm6                                                                                                                                                                                                                                                    
+++ b/lib/Red/Operators.pm6                                                                                                                                                                                                                                                    
@@ -408,13 +408,13 @@ multi prefix:<!>(Red::AST $a) is export {                                                                                                                                                                                                                
     Red::AST::Not.new: $a                                                                                                                                                                                                                                                     
 }                                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                               
-#multi prefix:<not>(Red::AST::In $a) is export {                                                                                                                                                                                                                              
-#    $a.not;                                                                                                                                                                                                                                                                  
-#}                                                                                                                                                                                                                                                                            
-#                                                                                                                                                                                                                                                                             
-#multi prefix:<!>(Red::AST::In $a) is export {                                                                                                                                                                                                                                
-#    $a.not;                                                                                                                                                                                                                                                                  
-#}                                                                                                                                                                                                                                                                            
+multi prefix:<not>(Red::AST::In $a) is export {                                                                                                                                                                                                                               
+    $a.not;                                                                                                                                                                                                                                                                   
+}                                                                                                                                                                                                                                                                             
+                                                                                                                                                                                                                                                                              
+multi prefix:<!>(Red::AST::In $a) is export {                                                                                                                                                                                                                                 
+    $a.not;                                                                                                                                                                                                                                                                   
+}                                                                                                                                                                                                                                                                             
 
 multi prefix:<so>(Red::AST $a) is export {
     Red::AST::So.new: $a
diff --git a/lib/X/Red/Exceptions.pm6 b/lib/X/Red/Exceptions.pm6
index c8a382a..9ca3b95 100644
--- a/lib/X/Red/Exceptions.pm6
+++ b/lib/X/Red/Exceptions.pm6
@@ -66,4 +66,4 @@ class X::Red::Driver::Mapped::Unique is X::Red::Driver::Mapped {
 class X::Red::Driver::Mapped::TableExists is X::Red::Driver::Mapped {
     has Str $.table is required;
     method msg { "Table $!table already exists" }
-}
+}
\ No newline at end of file
~

@bazzaar
Copy link

bazzaar commented Apr 8, 2019

In Red/Operators.pm6, lines 403-410 refer to a class Red::AST::Not which I cannot find.

@FCO
Copy link
Owner Author

FCO commented Apr 8, 2019

I looks it doesn't exists on META6.json.
Would you mind to test with it, please?

It's here: https://github.com/FCO/Red/blob/master/lib/Red/AST/Unary.pm6#L41

@FCO
Copy link
Owner Author

FCO commented Apr 8, 2019

No, it should only need a use Red::AST::Unary;

@bazzaar
Copy link

bazzaar commented Apr 8, 2019

I added a use Red::AST::Unary; to Red/Operators.pm6 but I still get the same error, it was already in the META6.json file

@FCO
Copy link
Owner Author

FCO commented Apr 8, 2019

@bazzaar what's your Rakudo version?

@bazzaar
Copy link

bazzaar commented Apr 8, 2019

bazzaar@linux-box:~/git_projects/Red> perl6 -v
This is Rakudo Star version 2019.03.1 built on MoarVM version 2019.03
implementing Perl 6.d.

Is that what you mean?

@FCO
Copy link
Owner Author

FCO commented Apr 8, 2019

~/Red # zef install .
===> Searching for missing dependencies: DB::Pg, Test::META
===> Searching for missing dependencies: LibUUID, JSON::Fast, Test::When, META6, URI, License::SPDX
===> Searching for missing dependencies: JSON::Class, JSON::Class:ver<0.0.5+>
===> Searching for missing dependencies: JSON::Marshal, JSON::Unmarshal
===> Searching for missing dependencies: JSON::Name
===> Testing: Test::When:ver<1.001008>
===> Testing [OK] for Test::When:ver<1.001008>
===> Testing: JSON::Fast:ver<0.9.12>
===> Testing [OK] for JSON::Fast:ver<0.9.12>
===> Testing: JSON::Name:ver<0.0.4>:auth<github:jonathanstowe>:api<1.0>
===> Testing [OK] for JSON::Name:ver<0.0.4>:auth<github:jonathanstowe>:api<1.0>
===> Testing: JSON::Marshal:ver<0.0.17>:auth<github:jonathanstowe>:api<1.0>
===> Testing [OK] for JSON::Marshal:ver<0.0.17>:auth<github:jonathanstowe>:api<1.0>
===> Testing: JSON::Unmarshal:ver<0.08>
===> Testing [OK] for JSON::Unmarshal:ver<0.08>
===> Testing: JSON::Class:ver<0.0.12>:auth<github:jonathanstowe>:api<1.0>
===> Testing [OK] for JSON::Class:ver<0.0.12>:auth<github:jonathanstowe>:api<1.0>
===> Testing: META6:ver<0.0.23>:auth<github:jonathanstowe>:api<1.0>
===> Testing [OK] for META6:ver<0.0.23>:auth<github:jonathanstowe>:api<1.0>
===> Testing: URI:ver<0.2.0>
===> Testing [OK] for URI:ver<0.2.0>
===> Testing: License::SPDX:ver<3.4.0>:auth<github:jonathanstowe>:api<1.0>
===> Testing [OK] for License::SPDX:ver<3.4.0>:auth<github:jonathanstowe>:api<1.0>
===> Testing: Test::META:ver<0.0.16>:auth<github:jonathanstowe>:api<1.0>
# the following may make some diagnostics from the module itself
===> Testing [OK] for Test::META:ver<0.0.16>:auth<github:jonathanstowe>:api<1.0>
===> Testing: LibUUID:ver<0.5>:auth<github:CurtTilmes>
===> Testing [OK] for LibUUID:ver<0.5>:auth<github:CurtTilmes>
===> Testing: DB::Pg:ver<0.6>
===> Testing [OK] for DB::Pg:ver<0.6>
===> Testing: Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Testing [OK] for Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Installing: Test::When:ver<1.001008>
===> Installing: JSON::Fast:ver<0.9.12>
===> Installing: JSON::Name:ver<0.0.4>:auth<github:jonathanstowe>:api<1.0>
===> Installing: JSON::Marshal:ver<0.0.17>:auth<github:jonathanstowe>:api<1.0>
===> Installing: JSON::Unmarshal:ver<0.08>
===> Installing: JSON::Class:ver<0.0.12>:auth<github:jonathanstowe>:api<1.0>
===> Installing: META6:ver<0.0.23>:auth<github:jonathanstowe>:api<1.0>
===> Installing: URI:ver<0.2.0>
===> Installing: License::SPDX:ver<3.4.0>:auth<github:jonathanstowe>:api<1.0>
===> Installing: Test::META:ver<0.0.16>:auth<github:jonathanstowe>:api<1.0>
===> Installing: LibUUID:ver<0.5>:auth<github:CurtTilmes>
===> Installing: DB::Pg:ver<0.6>
===> Installing: Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
~/Red # perl6 -v
This is Rakudo version 2019.03.1 built on MoarVM version 2019.03
implementing Perl 6.d.
~/Red # 

@bazzaar
Copy link

bazzaar commented Apr 8, 2019

Thanks for following up on this @FCO , I'll delete my fork of Red, and my local clone of it, and get a new fork/clone of FCO/Red master. Hopefully that'll do the trick. I'll check I've got all those modules up to date too.

@bazzaar
Copy link

bazzaar commented Apr 8, 2019

Well things have not changed unfortunately (but I do notice one of my modules is out of date compared to yours, not sure why) :

bazzaar@linux-box:~/git_projects/p6code> git clone https://github.com/bazzaar/Red.git
Cloning into 'Red'...
remote: Enumerating objects: 85, done.
remote: Counting objects: 100% (85/85), done.
remote: Compressing objects: 100% (60/60), done.
remote: Total 2747 (delta 40), reused 49 (delta 20), pack-reused 2662
Receiving objects: 100% (2747/2747), 424.30 KiB | 1.19 MiB/s, done.
Resolving deltas: 100% (1790/1790), done.
bazzaar@linux-box:~/git_projects/p6code> cd Red
bazzaar@linux-box:~/git_projects/p6code/Red> zef install --force-install .
===> Testing: Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Testing [OK] for Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Installing: Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Install [FAIL] for Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>: ===SORRY!=== Error while compiling /home/bazzaar/git_projects/p6code/Red/site#sources/A2B88934DAD40D45031A63C4FD64D8674E76283D (Red::Operators)
Invalid typename 'Red::AST::In' in parameter declaration.
at /home/bazzaar/git_projects/p6code/Red/site#sources/A2B88934DAD40D45031A63C4FD64D8674E76283D (Red::Operators):411
------> multi prefix:<not>(Red::AST::In⏏ $a) is export {

===SORRY!=== Error while compiling /home/bazzaar/git_projects/p6code/Red/site#sources/A2B88934DAD40D45031A63C4FD64D8674E76283D (Red::Operators)
Invalid typename 'Red::AST::In' in parameter declaration.
at /home/bazzaar/git_projects/p6code/Red/site#sources/A2B88934DAD40D45031A63C4FD64D8674E76283D (Red::Operators):411
------> multi prefix:<not>(Red::AST::In⏏ $a) is export {

Excerpt from zef list --installed
(LibUUID:ver<0.2> vs. yourLibUUID:ver<0.5> )

DB::Pg:ver<0.6>
JSON::Class:ver<0.0.12>:auth<github:jonathanstowe>:api<1.0>
JSON::Fast:ver<0.9.12>
JSON::Marshal:ver<0.0.17>:auth<github:jonathanstowe>:api<1.0>
JSON::Name:ver<0.0.4>:auth<github:jonathanstowe>:api<1.0>
JSON::Unmarshal:ver<0.08>
##### LibUUID:ver<0.2>:auth<github:CurtTilmes>
License::SPDX:ver<3.4.0>:auth<github:jonathanstowe>:api<1.0>
META6:ver<0.0.23>:auth<github:jonathanstowe>:api<1.0>
Red:ver<0.0.3>:api<0>
Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
Test::META:ver<0.0.16>:auth<github:jonathanstowe>:api<1.0>
Test::When:ver<1.001008>
URI:ver<0.2.0>

So, I'll update it :

bazzaar@linux-box:~/git_projects/p6code> zef install --force-install LibUUID                                                                                                                                                                                                        
===> Searching for: LibUUID                                                                                                                                                                                                                                                    
===> Updating cpan mirror: https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/cpan1.json                                                                                                                                                                          
===> Updating p6c mirror: http://ecosystem-api.p6c.org/projects1.json                                                                                                                                                                                                          
===> Updated p6c mirror: http://ecosystem-api.p6c.org/projects1.json                                                                                                                                                                                                           
===> Updated cpan mirror: https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/cpan1.json                                                                                                                                                                           
===> Searching for missing dependencies: NativeLibs:auth<github:salortiz>                                                                                                                                                                                                      
===> Testing: NativeLibs:ver<0.0.7>:auth<github:salortiz>                                                                                                                                                                                                                      
===> Testing [OK] for NativeLibs:ver<0.0.7>:auth<github:salortiz>                                                                                                                                                                                                              
===> Testing: LibUUID:ver<0.5>:auth<github:CurtTilmes>                                                                                                                                                                                                                         
===> Testing [OK] for LibUUID:ver<0.5>:auth<github:CurtTilmes>                                                                                                                                                                                                                 
===> Installing: NativeLibs:ver<0.0.7>:auth<github:salortiz>                                                                                                                                                                                                                   
===> Installing: LibUUID:ver<0.5>:auth<github:CurtTilmes>                                                                                                                                                                                                                      

... results in different error but still no joy ..

bazzaar@linux-box:~/git_projects/p6code/Red> zef install --force-install .
===> Testing: Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Testing [OK] for Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Installing: Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>
===> Install [FAIL] for Red:ver<0.0.3>:auth<Fernando Correa de Oliveira>:api<1>: ===SORRY!===
Function 'X::Red::Driver::Mapped::TableExists' needs parens to avoid gobbling block (or perhaps it's a class that's not declared or available in this scope?)
at /home/bazzaar/git_projects/p6code/Red/site#sources/D10D41AB1ED8F1B8E05FB2205140E2E2710D3419 (MetamodelX::Red::Model):234
------>     }⏏}
Missing block (apparently claimed by 'X::Red::Driver::Mapped::TableExists')
at /home/bazzaar/git_projects/p6code/Red/site#sources/D10D41AB1ED8F1B8E05FB2205140E2E2710D3419 (MetamodelX::Red::Model):234
------>     }⏏}

===SORRY!===
Function 'X::Red::Driver::Mapped::TableExists' needs parens to avoid gobbling block (or perhaps it's a class that's not declared or available in this scope?)
at /home/bazzaar/git_projects/p6code/Red/site#sources/D10D41AB1ED8F1B8E05FB2205140E2E2710D3419 (MetamodelX::Red::Model):234
------>     }⏏}
Missing block (apparently claimed by 'X::Red::Driver::Mapped::TableExists')
at /home/bazzaar/git_projects/p6code/Red/site#sources/D10D41AB1ED8F1B8E05FB2205140E2E2710D3419 (MetamodelX::Red::Model):234
------>     }⏏}

@FCO
Copy link
Owner Author

FCO commented Apr 8, 2019

That’s extremely odd... I’ve just created a docket image with your perl6 version (thanks @JJ) and Red dependencies (now I’m using it on travis) and I had no errors... what’s your SO? I couldn’t reproduce the error on Mac nor on docker (Debian and alpine)...

Sent with GitHawk

@FCO
Copy link
Owner Author

FCO commented Apr 8, 2019

@bazzar would you mind to test building and running the docket image? Thanks!

@FCO
Copy link
Owner Author

FCO commented Apr 8, 2019

@bazzaar I asked for help on #perl6 and tony-o and ugexe helped me a lot:
https://colabti.org/irclogger/irclogger_log/perl6?date=2019-04-08#l570
It seems that something is wrong with your perl6...

@bazzaar
Copy link

bazzaar commented Apr 9, 2019

@FCO thanks again for helping me with this. I saw tony-o's comment to look at the file :
at /home/bazzaar/git_projects/Red/site#sources/D10D41AB1ED8F1B8E05FB2205140E2E2710D3419 (MetamodelX::Red::Model):234
I did this, and knowing the error message about 'add missing parens to avoid the block being gobbled up', and reading Moritz Lenz's Perl6 Fundamentals Chapter 8 Section 2, it seems like the issue might be in /Red/lib/MetamodelX/Red/Model.pm6 : lines 231-236 :
the class X::Red::Driver::Mapped::TableExists is called with a conditional 'when' and so I think a pair of closing parens might be needed.
I've made the change to my local clone and zef install error has moved on to the infix class errors that I saw (above). I'll explore further, I'm learning a lot, even if I might be going down the wrong garden path.

@FCO
Copy link
Owner Author

FCO commented Apr 9, 2019

@bazzaar no, that file shouldn’t exists... the problem is that something has created some files on there... it seems to be trying to install it on the Red’s root dir...

Sent with GitHawk

@bazzaar
Copy link

bazzaar commented Apr 9, 2019

@FCO Aah, that puts a different complexion on things, I've never tried to install a local module before. I'll do some research. My perl6 has installed flawlessly, and I've installed a number of modules from the ecosystem (including Red) without any errors. For the local module install I've been running :
zef install --force-install .
from the Red root dir, is that wrong?

@FCO
Copy link
Owner Author

FCO commented Apr 9, 2019

No, that’s right, but probably your $PERL6LIB (or something like that) is pointing to “.”

Sent with GitHawk

@bazzaar
Copy link

bazzaar commented Apr 9, 2019

@FCO a final update, I just rebuilt my perl6, and set the PERL6LIB envvar prior to install the FCO/Red clone I got earlier today. It installed successfully :-) Thanks for your help, and I hope I didn't waste to much of your time. bazzaar

PS. I can confirm that the ordering of columns in newly created Pg tables is correctly preserved.

@FCO
Copy link
Owner Author

FCO commented Apr 9, 2019

Great! And did the order of the create table work? I hope you like Red! :)

@FCO FCO moved this from backlog to done in Documenting Aug 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

3 participants