Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    gael-boyenval
    @gael-boyenval
    Hi everyone, @keithwhor
    What i loved about nodal firsts demos and tuts, is that it was very easy to grasp the basics and that i'm able to be up and running with just few commands.
    The learning curve seem very smooth.
    However, i fill quite stuck now without more detailed "how to" documentations and videos, with concrete real world exemples.
    when can we expect more tutorials and documentation for back-end beginners like me ?
    billmakes
    @billmakes
    @robertguss I am experiencing the same error as Robert @keithwhor I am following the instatweet-api tutorial and I am getting an error stating .joinedBy function does not exist.
    Fabricio Nogueira
    @nogsantos
    @robertguss , @billmakes joinedBy function was removed, see in keithwhor/nodal@596ac11 . Now, in the last version installed by the cli, you have to use the file relationships.js like this video https://youtu.be/FNgRDihY_3I?t=8m7s .
    Fabricio Nogueira
    @nogsantos
    But, i miss more relationship functions like: "hasOne", "belongsTo", "hasMany", "belongsToMany"... I don't know, but It can be incorporated into the project in the future, or not?
    Artur
    @ArturAralin
    Hi all! Can someone tell me, can I change model fields if I already created model with CLI command "nodal g:model ModelName"?
    Fabricio Nogueira
    @nogsantos
    Yes, you can. With migrations $ nodal g:migration [model]
    up() {
        return [
          this.addColumn("employees","address1","string",{"nullable":false})
        ];
    }
    
    down() {
        return [
          this.dropColumn("employees","address1")
        ];
    }
    to add new column

    Rename column

    up() {
      return [
          this.renameColumn("employees","first_name","firstName"),
          this.renameColumn("employees","last_name","lastName")
        ];
    }
    down() {
      return [
        this.renameColumn("employees","firstName","first_name"),
        this.renameColumn("employees","lastName","last_name")
      ];
    }

    Change properties

    up() {
      return [
          this.alterColumn("employees","first_name","string",{"nullable":false,"unique":true})
      ];
    }
    down() {
      return [
          this.alterColumn("employees","first_name","string","")
      ];
    }

    Foreign keys

    up() {
      return [
          this.addColumn("employees","company_id","int"),
          this.addForeignKey("employees","companies")
      ];
    }
    down() {
      return [
          this.dropForeignKey("employees","companies"),
          this.dropColumn("employees","company_id")
      ];
    }
    Artur
    @ArturAralin
    @nogsantos thx! This is very helpful! I have one more question. Can nodal provide access control?
    Fabricio Nogueira
    @nogsantos
    @ArturAralin Yes, in this video you can get how to do that https://www.youtube.com/watch?v=WIjSA3-E42I
    Artur
    @ArturAralin
    @nogsantos thx u very much
    Fabricio Nogueira
    @nogsantos
    Artur
    @ArturAralin
    @nogsantos it's text version of screencsasts?
    Fabricio Nogueira
    @nogsantos
    @ArturAralin I believe so
    David d'Aquin
    @djdaquin
    Hi everyone, I was wondering if anyone knew how to join to a join using nodal. For example, if I join a user to a query, and that user has a permission level but that level is signified by an id from another table, how would I get the permission level table also joined into that query? Is this possible. Thanks.
    @keithwhor
    David d'Aquin
    @djdaquin
    will play with that a while
    David d'Aquin
    @djdaquin
    Worked. disregard
    Artur
    @ArturAralin
    Hi all! (time for stupid questions) Tell me pls, how i can get file, wich i sent to nodal? If it matters, file type is xlsx
    Fabricio Nogueira
    @nogsantos
    Base6
    Eddie Espinal
    @eddieespinal
    Hi guys, I have a quick question. Is there a way to order the returned json data ASC or DESC via the URL? I tried a few things but didn't work. I have a results that I would like to orderBy id DESC, but I don't want to hard code this into the app, but instead I was thinking in the URL. Thanks for your help.
    Ghost
    @ghost~58546158d73408ce4f3d9221
    @djdaquin how did you get it to work? I see the explanation about deep-joins, however, still having trouble... can you elaborate how you got it working?
    Ghost
    @ghost~58546158d73408ce4f3d9221
    any info on deep (nested) joins that works in the latest Nodal version is very much welcome
    Ghost
    @ghost~58546158d73408ce4f3d9221
    I became wiser in the meantime. Apparently the deep-joins explanation works quite well. However I'm still encountering some issues.
    I have the tables: matches > teams > players < users.
    As you can see, the players table has both the connection to teams AND users (team_id and user_id). That seems to make it more difficult. Using .join('teams__players') works but using .join('teams__players__user') generates an error: "TypeError: Cannot read property 'getModel' of null". (note: using 'teams__players__users', gives a relationship error, that's why i'm using user instead of users)
    Any ideas how to resolve that?
    Steffen Jahr
    @SteffenJahr
    Does anyone knows if Nodal will be maintained in the future or it is deprecated?
    Gabriel Aleme
    @egaleme
    i'm having difficulty using my nodal app in heroku with the db hosted in elephantsql. can anyone give me hints
    Ghost
    @ghost~58546158d73408ce4f3d9221
    What's the difficulty?
    Gabriel Aleme
    @egaleme
    @martinverhey_twitter i want to use production database elephantsql, but i dont know how to connect my nodal app to use it
    also, is it possible for a local nodal app to connect to remote db and do migrations?
    Ghost
    @ghost~58546158d73408ce4f3d9221
    Did you try configuring the settings of the remote db in config/db.json? I haven't tried it yet, but it seems like you can setup IP of the remote db as "host" and the port as "port". But it does look slightly different for production... not sure.
    Ghost
    @ghost~58546158d73408ce4f3d9221
    I'd think the migrations would also work remotely. As long as your connected on the DB all functionality will stay the same local or remote. At least, I'd think so. Cannot confirm.
    did you get Nodal running on Heroku? I was having some trouble with that earlier. Did you have to setup a special Procfile or something to get it running properly?
    Gabriel Aleme
    @egaleme
    yes i have an app running on heroku and elephansql as db. https://stockit-app.herokuapp.com. it is a backend app for my mobile app.
    i did not use procfile. just pushed it to heroku
    Gabriel Aleme
    @egaleme
    i just wonder if nodaljs is ready for production; what i mean can i use it for real world apps with confident as hapijs
    adw45
    @adw45
    Hey I'm trying to find some documentation on how add more add routing for the controllers that aren't just the traditional CRUD methods. like get /v1/service/{id} & get /v1/service/other-endpoint/{id}
    router.route('/v1/service/{id}').use(V1serviceController);
    router.route('/v1/service/locate/{zip}').use(V1serviceController);
    I cant find a way to map the second one to my locate() function.
    adw45
    @adw45
    @keithwhor
    Artur
    @ArturAralin
    Hi all! I like a Nodal, but i never see a snippets for text editors. it makes me sad and i made snippets for sublime and vscode. Here repo https://github.com/ArturAralin/nodal-snippets. In a few days i add all methods from docs. I'll be glad to listen your wishes
    somecallmemike
    @somecallmemike
    Hello, I am trying to develop a multi tenant app using Nodal, and in my use case I need to restrict queries by "company_id" in most models. Is there a good way to expose a user's company_id or the whole user record in each controller so I can include the company_id as a restriction in the where clause?
    Ryan Oldham
    @codershop
    @somecallmemike Have you set up authentication like the demo? If so, you can just call this.authenticate and pass it a callback. It will pass you the user object. The screencast on setting up auth can be seen here: https://youtu.be/WIjSA3-E42I?list=PLkbxHKk95eJZ4-oVyGl-3hIdNxcesgT2d
    Timofey Biryukov
    @TimofeyBiryukov
    Hello, I've searched for an answer but could not find anything. Plus documentation on the site doesn't seam to have controllers documented.
    Question is is there a way to do custom controller methods.
    Like /user/me for example. I see how I can attach separate controller to a route and have index method responsible for handling this route but is there a way to have custom methods inside controllers with custom route to them?
    Luiz Guilherme Picorelli
    @picorelli
    How can I update database with a modified class and migration?
    Marwan Rabbâa
    @waghanza
    hi, I've opened an issue to ask for author consent about his consent to add nodal on a benchmark
    the-benchmarker/web-frameworks#1589
    @/all