For example:
{
- sets: [
+ "sets": [
{
- class: 'Artist',
- ids: ['1', '3']
+ "class": "Artist",
+ "ids": ["1", "3"]
},
{
- class: 'Producer',
- ids: ['5'],
- fetch: [
+ "class": "Producer",
+ "ids": ["5"],
+ "fetch": [
{
- rel: 'artists',
- quantity: '2'
+ "rel": "artists",
+ "quantity": "2"
}
]
}
rule to specify this. For example:
{
- sets: [
+ "sets": [
{
- class: 'Artist',
- ids: ['1', '3']
+ "class": "Artist",
+ "ids": ["1", "3"]
},
{
- class: 'Producer',
- ids: ['5'],
- fetch: [
+ "class": "Producer",
+ "ids": ["5"],
+ "fetch": [
{
- rel: 'artists',
- quantity: '2'
+ "rel": "artists",
+ "quantity": "2"
}
]
}
],
- rules: {
- Artist: {
- fetch: [ {
- rel: 'cds',
- quantity: 'all'
+ "rules": {
+ "Artist": {
+ "fetch": [ {
+ "rel": "cds",
+ "quantity": "all"
} ]
}
}
to CD. This is eqivalent to:
{
- sets: [
+ "sets": [
{
- class: 'Artist',
- ids: ['1', '3'],
- fetch: [ {
- rel: 'cds',
- quantity: 'all'
+ "class": "Artist",
+ "ids": ["1", "3"],
+ "fetch": [ {
+ "rel": "cds",
+ "quantity": "all"
} ]
},
{
- class: 'Producer',
- ids: ['5'],
- fetch: [ {
- rel: 'artists',
- quantity: '2',
- fetch: [ {
- rel: 'cds',
- quantity: 'all'
+ "class": "Producer",
+ "ids": ["5"],
+ "fetch": [ {
+ "rel": "artists",
+ "quantity": "2",
+ "fetch": [ {
+ "rel": "cds",
+ "quantity": "all"
} ]
} ]
}
example:
{
- sets: [ {
- class: 'Producer',
- ids: ['5']
+ "sets": [ {
+ "class": "Producer",
+ "ids": ["5"]
} ],
- includes: [
- { file: 'base.json' }
+ "includes": [
+ { "file": "base.json" }
]
}
DateTime::Format::* can parse. For example:
{
- sets: [ {
- class: 'RecentItems',
- ids: ['9']
+ "sets": [ {
+ "class": "RecentItems",
+ "ids": ["9"]
} ],
- datetime_relative : "2007-10-30 00:00:00"
+ "datetime_relative": "2007-10-30 00:00:00"
}
This will work when dumping from a MySQL database and will cause any datetime
hash with one attribute - fetch. Set fetch to 1 or 0.
{
- might_have: { fetch: 1 },
- sets: [
+ "might_have": { "fetch": 1 },
+ "sets": [
{
- class: 'Artist',
- ids: ['1', '3']
+ "class": "Artist",
+ "ids": ["1", "3"]
},
{
- class: 'Producer',
- ids: ['5']
+ "class": "Producer",
+ "ids": ["5"]
}
]
}
a JSON representation of a DBIx::Class search clause. For example:
{
- sets: [{
- class: 'Artist',
- quantiy: 'all',
- cond: { name: 'Dave' }
+ "sets": [{
+ "class": "Artist",
+ "quantiy": "all",
+ "cond": { "name": "Dave" }
}]
}
This could be specified in the cond hash like so:
{
- sets: [ {
- class: 'Artist',
- quantiy: 'all',
- cond: { no1_singles: '\> no1_albums' }
+ "sets": [ {
+ "class": "Artist",
+ "quantiy": "all",
+ "cond": { "no1_singles": "\> no1_albums" }
} ]
}
An array of relationships to be used in the cond clause.
{
- sets: [ {
- class: 'Artist',
- quantiy: 'all',
- cond: { 'cds.position': { '>': 4 } },
- join: ['cds']
+ "sets": [ {
+ "class": "Artist",
+ "quantiy": "all",
+ "cond": { "cds.position": { ">": 4 } },
+ "join": ["cds"]
} ]
}
Must be an array of hashes. Specifies which rels to also dump. For example:
{
- sets: [ {
- class: 'Artist',
- ids: ['1', '3'],
- fetch: [ {
- rel: 'cds',
- quantity: '3',
- cond: { position: '2' }
+ "sets": [ {
+ "class": "Artist",
+ "ids": ["1", "3"],
+ "fetch": [ {
+ "rel": "cds",
+ "quantity": "3",
+ "cond": { "position": "2" }
} ]
} ]
}
Drew Taylor <taylor.andrew.j@gmail.com>
+ Frank Switalski <fswitalski@gmail.com>
+
=head1 LICENSE
This library is free software under the same license as perl itself