Coder Social home page Coder Social logo

Composite Primary Key about npoco HOT 7 CLOSED

schotime avatar schotime commented on August 20, 2024
Composite Primary Key

from npoco.

Comments (7)

schotime avatar schotime commented on August 20, 2024

At the moment you can't. Can you elaborate on the scenario you are trying to enable?

from npoco.

enriko-riba avatar enriko-riba commented on August 20, 2024

As always with such stuff: new project, foreign DB which I am not supposed to change...
Table has a composite PK where one of them is Identity and the other is is not. Currently its all or nothing regarding the autoincrement - which is fine, until you stumble upon a table like this.
I solved this particular problem with good old SQL Execute but it kinda defeats the purpose...

from npoco.

schotime avatar schotime commented on August 20, 2024

Ok...I think I understand the issue. I'll have to look into what can be done, because at the moment autoIncrement is just true or false.

from npoco.

enriko-riba avatar enriko-riba commented on August 20, 2024

Would it make sense to add autoincrement on the field level instead of the class level? It would behave just like the ResultColumn attribute.

from npoco.

schotime avatar schotime commented on August 20, 2024

It might, however I need to look at the implications of that...not just for Sql Server as well.

from npoco.

rganz avatar rganz commented on August 20, 2024

Oh... for me this is a serious issue. I have distributed tables over various locations, and they are merged in a central location, so that an autoincrement is not enough. I need at least an additional location field in the primary key...

from npoco.

rganz avatar rganz commented on August 20, 2024

Sorry, I was too fast... As I see, a composite Primary Key is possible, just not with an autoincrement. Unfortunately in another table I need exactly this as well...

from npoco.

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.