-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
944f2b7
commit 09bdc15
Showing
33 changed files
with
109 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
Feature: autoIncrement | ||
====================== | ||
|
||
Enable this test in `package.json` with: `"features": ["autoIncrement"]` | ||
|
||
When autoIncrement is set to true on an attribute and no value is provided for it a new unique value | ||
will be assigned by the adapter before the record is created. It is guaranteed that the adapter will | ||
assign a unique value not present on any existing record. The values assigned automatically will not | ||
necessarily be sequential, which accommodates the use of UUIDs. If a value for the attribute is | ||
present in the data provided for a new record it will be saved as-is without any guarantee of uniqueness. | ||
The autoIncrement option has no effect when updating existing records. | ||
|
||
Usage on Waterline models: | ||
|
||
``` | ||
attributes: { | ||
id: { | ||
type: "integer", // or "string" | ||
autoIncrement: true | ||
} | ||
} | ||
``` | ||
|
||
## Sub-Features | ||
|
||
### autoIncrement.sequential | ||
|
||
Enable this test in `package.json` with: `"features": ["autoIncrement.sequential"]` | ||
|
||
If the adapter will provide sequential unique values, for example increasing integers, then it is | ||
further guaranteed that the next value will be the last saved value plus one increment. If a value | ||
is provided and is larger than the current auto-inc counter the counter will be bumped to the | ||
provided value. If a provided value is less than or equal to the auto-inc counter value the | ||
counter will remain unchanged, and again there will be no guaranteed that this value is unique. | ||
|
||
This sub-feature is a special case/implementation detail of the `autoIncrement` attribute by | ||
selected adapters and is not configured explicitly. | ||
Feature: autoIncrement | ||
====================== | ||
|
||
Enable this test in `package.json` with: `"features": ["autoIncrement"]` | ||
|
||
When autoIncrement is set to true on an attribute and no value is provided for it a new unique value | ||
will be assigned by the adapter before the record is created. It is guaranteed that the adapter will | ||
assign a unique value not present on any existing record. The values assigned automatically will not | ||
necessarily be sequential, which accommodates the use of UUIDs. If a value for the attribute is | ||
present in the data provided for a new record it will be saved as-is without any guarantee of uniqueness. | ||
The autoIncrement option has no effect when updating existing records. | ||
|
||
Usage on Waterline models: | ||
|
||
``` | ||
attributes: { | ||
id: { | ||
type: 'number', // or 'string' | ||
autoIncrement: true | ||
} | ||
} | ||
``` | ||
|
||
## Sub-Features | ||
|
||
### autoIncrement.sequential | ||
|
||
Enable this test in `package.json` with: `"features": ["autoIncrement.sequential"]` | ||
|
||
If the adapter will provide sequential unique values, for example increasing integers, then it is | ||
further guaranteed that the next value will be the last saved value plus one increment. If a value | ||
is provided and is larger than the current auto-inc counter the counter will be bumped to the | ||
provided value. If a provided value is less than or equal to the auto-inc counter value the | ||
counter will remain unchanged, and again there will be no guaranteed that this value is unique. | ||
|
||
This sub-feature is a special case/implementation detail of the `autoIncrement` attribute by | ||
selected adapters and is not configured explicitly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
09bdc15
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see balderdashy/sails-postgresql#278