Code Monkey home page Code Monkey logo

Comments (7)

benjie avatar benjie commented on July 1, 2024 1

You’re almost there; change the ’categoria’ to ’@foreignFieldName products’ (but watch out for the smart quotes my phone added - sorry)

from pg-simplify-inflector.

mateo2181 avatar mateo2181 commented on July 1, 2024 1

I have restarted the server and works.
Thanks!

from pg-simplify-inflector.

benjie avatar benjie commented on July 1, 2024

As a shortcut for single-key relations? That seems a reasonable idea, but what would we call the forward relation part on the same column? Maybe the smart comment should be slightly different, e.g. “relationFieldName” / “relationForeignFieldName”?

from pg-simplify-inflector.

mateo2181 avatar mateo2181 commented on July 1, 2024

I need to add a smart comment to use "products" instead of "productsByCategoryId" in the relationship one to many. Where I should add that comment? directly in postgres?

I have two tables:
products

  • name
  • categoryId

categories

  • name

I am trying this:
COMMENT ON CONSTRAINT "productos_categoriaId_fkey" on productos is 'categoria' .
but not works.

from pg-simplify-inflector.

mateo2181 avatar mateo2181 commented on July 1, 2024

Yes, I have tried that, but the response is always the same and don't works.
This is the query that I run in pg Admin.
Screenshot (1)

And this is my query in Graphiql.
Screenshot (2)

from pg-simplify-inflector.

benjie avatar benjie commented on July 1, 2024

In the second query you’re querying productosCategorias (not productos) so I’d expect constraint named something like productos_categorias_categoryId_fkey

from pg-simplify-inflector.

mateo2181 avatar mateo2181 commented on July 1, 2024

But there is not constraint on productosCategorias table, because the fk is on productos table.

from pg-simplify-inflector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.