Giter VIP home page Giter VIP logo

Comments (4)

xrotwang avatar xrotwang commented on August 19, 2024

Yes, the w3c spec support composite foreign keys. Generally, I think, it is best to not regard "foreign key" as some sort of column type, but follow the "constraint" paradigm: i.e. "foreign keys" is a list of constraints on the values of a row, rather than a core property of the individual columns. Thus it shouldn't interfere with writing at all, but will come into play only when calling a dataset's validate method.

from clldutils.

xrotwang avatar xrotwang commented on August 19, 2024

So if we want to add more support for handling of foreign keys, we may want to introduce Constraint objects, pretty much like SQLAlchemy does it.

from clldutils.

Anaphory avatar Anaphory commented on August 19, 2024

How are you currently handling foreign keys to languages.csv etc.? I could not find an example and have therefore no idea what they should look like

from clldutils.

Anaphory avatar Anaphory commented on August 19, 2024

Ah, now I see. I shall adapt the script I sent you. I had – once again – misunderstood what needs to go there, but after adding an explicit LanguageTable I see how that is implemented and now I understand how Foreign Keys should be specified in the metadata json, and that they are actually separate from the columns.

Their semantics (constraints, 1:n, uniqueness, …) is an entirely different issue, and I'm fine with it not being specified at the moment.

from clldutils.

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.