-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
34 changed files
with
2,434 additions
and
197 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# | ||
# JBZoo Toolbox - Csv-Blueprint. | ||
# | ||
# This file is part of the JBZoo Toolbox project. | ||
# For the full copyright and license information, please view the LICENSE | ||
# file that was distributed with this source code. | ||
# | ||
# @license MIT | ||
# @copyright Copyright (C) JBZoo.com, All rights reserved. | ||
# @see https://github.com/JBZoo/Csv-Blueprint | ||
# | ||
|
||
name: Presets for database columns | ||
description: This schema contains basic rules for database user data. | ||
|
||
columns: | ||
- name: id | ||
description: Unique identifier, usually used to denote a primary key in databases. | ||
example: 12345 | ||
rules: | ||
not_empty: true | ||
is_trimmed: true | ||
is_int: true | ||
num_min: 1 | ||
aggregate_rules: | ||
is_unique: true | ||
sorted: [ asc, numeric ] | ||
|
||
- name: status | ||
description: Status in database | ||
example: active | ||
rules: | ||
not_empty: true | ||
allow_values: [ active, inactive, pending, deleted ] |
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# | ||
# JBZoo Toolbox - Csv-Blueprint. | ||
# | ||
# This file is part of the JBZoo Toolbox project. | ||
# For the full copyright and license information, please view the LICENSE | ||
# file that was distributed with this source code. | ||
# | ||
# @license MIT | ||
# @copyright Copyright (C) JBZoo.com, All rights reserved. | ||
# @see https://github.com/JBZoo/Csv-Blueprint | ||
# | ||
|
||
name: Complite list of preset features | ||
description: This schema contains all the features of the presets. | ||
|
||
presets: | ||
# The basepath for the preset is `.` (current directory of the current schema file). | ||
# Define alias "db" for schema in `./preset_database.yml`. | ||
db: preset_database.yml # Or `db: ./preset_database.yml`. It's up to you. | ||
|
||
# For example, you can use a relative path. | ||
users: ./../schema-examples/preset_users.yml | ||
|
||
# Or you can use an absolute path. | ||
# db: /full/path/preset_database.yml | ||
|
||
filename_pattern: { preset: users } # Take the filename pattern from the preset. | ||
structural_rules: { preset: users } # Take the global rules from the preset. | ||
csv: { preset: users } # Take the CSV settings from the preset. | ||
|
||
columns: | ||
# Use name of column from the preset. | ||
# "db" is alias. "id" is column `name` in `preset_database.yml`. | ||
- preset: 'db/id' | ||
|
||
# Use column index. "db" is alias. "0" is column index in `preset_database.yml`. | ||
- preset: 'db/0' | ||
- preset: 'db/0:' | ||
|
||
# Use column index and column name. It useful if column name is not unique. | ||
- preset: 'db/0:id' | ||
|
||
# Use only `rules` of "status" column from the preset. | ||
- name: My column | ||
rules: | ||
preset: 'db/status' | ||
|
||
# Override only `aggregate_rules` from the preset. | ||
# Use only `aggregate_rules` of "id" column from the preset. | ||
# We strictly take only the very first column (index = 0). | ||
- name: My column | ||
aggregate_rules: | ||
preset: 'db/0:id' | ||
|
||
# Combo!!! If you're a risk-taker or have a high level of inner zen. :) | ||
# Creating a column from three other columns. | ||
# In fact, it will merge all three at once with key replacement. | ||
- name: Crazy combo! | ||
description: > # Just a great advice. | ||
I like to take risks, too. | ||
Be careful. Use your power wisely. | ||
example: ~ # Ignore inherited "example" value. Set it `null`. | ||
preset: 'users/login' | ||
rules: | ||
preset: 'users/email' | ||
not_empty: true # Disable the rule from the preset. | ||
aggregate_rules: | ||
preset: 'db/0' |
Oops, something went wrong.