Menu

Unique constraint

MRev
2022-07-12
2022-07-18
  • MRev

    MRev - 2022-07-12

    Hello!

    I am new to NSBase, started to play with it quite a bit, it is really a jewel of a RAD!!

    I have one point I could not solve so far, though: how do you define a constraint on a table where a combination of several fields has to be unique.

    In SQLite, I would define the constraint UNIQUE (field1, field2, ...) ON CONFLICT REPLACE, for example.

    I see NSBase allows a unique constraint on a single field, but did not find how to make it work on a combination of several fields.

    Thanks in advance!

    oparpmr

     
  • neuts-jl

    neuts-jl - 2022-07-16

    Hello,
    Indeed, NSbase manages simple constraints, which has been the general trend for several years: simplicity of the MCD and improved performance. just convert your schema....

     
    • MRev

      MRev - 2022-07-16

      Hello Surfvite,

      Understood, thanks.

      Michel

      On Sat, Jul 16, 2022 at 7:34 AM surfvite surfvite@users.sourceforge.net
      wrote:

      Hello,
      Indeed, NSbase manages simple constraints, which has been the general
      trend for several years: simplicity of the MCD and improved performance.
      just convert your schema....


      Unique constraint
      https://sourceforge.net/p/nsbase/forum/general/thread/36732a0a25/?limit=25#182e


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/nsbase/forum/general/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
      • MRev

        MRev - 2022-07-18

        Hi Surfvite,

        I am coming back on this issue of single vs multiple fields constraint for defining the uniqueness of a row.

        You mentioned the MCD (Modele Conceptuel de Donnees), and recent trend of going for a unique field.

        Do you have any link to explanations on the subject. I tried to find some but could not. I need to figure out a simple solution (without going into creating a field which is the hash of the concatenation of those fields, trigger, etc.).

        You state it is a trend, ok. But then how is this specific problem solved?

        Thanks in advance for your input.

        MRev

         

Log in to post a comment.