-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
19 changed files
with
204 additions
and
32 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
53 changes: 53 additions & 0 deletions
53
martin-mbtiles/tests/snapshots/mbtiles__databases@v2__flat-with-hash.snap
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,53 @@ | ||
--- | ||
source: martin-mbtiles/tests/mbtiles.rs | ||
expression: actual_value | ||
--- | ||
[[]] | ||
type = 'table' | ||
tbl_name = 'metadata' | ||
sql = ''' | ||
CREATE TABLE metadata ( | ||
name text NOT NULL PRIMARY KEY, | ||
value text)''' | ||
values = [ | ||
'( "agg_tiles_hash", "5364C57282B73C341D5D801B8F7675C4" )', | ||
'( "md-edit", "value - v2" )', | ||
'( "md-new", "value - new" )', | ||
'( "md-same", "value - same" )', | ||
] | ||
|
||
[[]] | ||
type = 'table' | ||
tbl_name = 'tiles_with_hash' | ||
sql = ''' | ||
CREATE TABLE tiles_with_hash ( | ||
zoom_level integer NOT NULL, | ||
tile_column integer NOT NULL, | ||
tile_row integer NOT NULL, | ||
tile_data blob, | ||
tile_hash text, | ||
PRIMARY KEY(zoom_level, tile_column, tile_row))''' | ||
values = [ | ||
'( 5, 0, 0, blob(same), "51037A4A37730F52C8732586D3AAA316" )', | ||
'( 5, 0, 1, blob(edit-v2), "FF76830FF90D79BB335884F256031731" )', | ||
'( 5, 1, 0, blob(new), "22AF645D1859CB5CA6DA0C484F1F37EA" )', | ||
'( 6, 0, 0, blob(same), "51037A4A37730F52C8732586D3AAA316" )', | ||
'( 6, 0, 1, blob(edit-v2a), "03132BFACDB00CC63D6B7DD98D974DD5" )', | ||
'( 6, 1, 4, blob(one-keep-one-remove), "EFC416C7C53A81E7363BE6C1A389131A" )', | ||
'( 6, 1, 6, blob(new), "22AF645D1859CB5CA6DA0C484F1F37EA" )', | ||
] | ||
|
||
[[]] | ||
type = 'index' | ||
tbl_name = 'metadata' | ||
|
||
[[]] | ||
type = 'index' | ||
tbl_name = 'tiles_with_hash' | ||
|
||
[[]] | ||
type = 'view' | ||
tbl_name = 'tiles' | ||
sql = ''' | ||
CREATE VIEW tiles AS | ||
SELECT zoom_level, tile_column, tile_row, tile_data FROM tiles_with_hash''' |
45 changes: 45 additions & 0 deletions
45
martin-mbtiles/tests/snapshots/mbtiles__databases@v2__flat.snap
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,45 @@ | ||
--- | ||
source: martin-mbtiles/tests/mbtiles.rs | ||
expression: actual_value | ||
--- | ||
[[]] | ||
type = 'table' | ||
tbl_name = 'metadata' | ||
sql = ''' | ||
CREATE TABLE metadata ( | ||
name text NOT NULL PRIMARY KEY, | ||
value text)''' | ||
values = [ | ||
'( "agg_tiles_hash", "5364C57282B73C341D5D801B8F7675C4" )', | ||
'( "md-edit", "value - v2" )', | ||
'( "md-new", "value - new" )', | ||
'( "md-same", "value - same" )', | ||
] | ||
|
||
[[]] | ||
type = 'table' | ||
tbl_name = 'tiles' | ||
sql = ''' | ||
CREATE TABLE tiles ( | ||
zoom_level integer NOT NULL, | ||
tile_column integer NOT NULL, | ||
tile_row integer NOT NULL, | ||
tile_data blob, | ||
PRIMARY KEY(zoom_level, tile_column, tile_row))''' | ||
values = [ | ||
'( 5, 0, 0, blob(same) )', | ||
'( 5, 0, 1, blob(edit-v2) )', | ||
'( 5, 1, 0, blob(new) )', | ||
'( 6, 0, 0, blob(same) )', | ||
'( 6, 0, 1, blob(edit-v2a) )', | ||
'( 6, 1, 4, blob(one-keep-one-remove) )', | ||
'( 6, 1, 6, blob(new) )', | ||
] | ||
|
||
[[]] | ||
type = 'index' | ||
tbl_name = 'metadata' | ||
|
||
[[]] | ||
type = 'index' | ||
tbl_name = 'tiles' |
90 changes: 90 additions & 0 deletions
90
martin-mbtiles/tests/snapshots/mbtiles__databases@v2__normalized.snap
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,90 @@ | ||
--- | ||
source: martin-mbtiles/tests/mbtiles.rs | ||
expression: actual_value | ||
--- | ||
[[]] | ||
type = 'table' | ||
tbl_name = 'images' | ||
sql = ''' | ||
CREATE TABLE images ( | ||
tile_id text NOT NULL PRIMARY KEY, | ||
tile_data blob)''' | ||
values = [ | ||
'( "03132BFACDB00CC63D6B7DD98D974DD5", blob(edit-v2a) )', | ||
'( "22AF645D1859CB5CA6DA0C484F1F37EA", blob(new) )', | ||
'( "51037A4A37730F52C8732586D3AAA316", blob(same) )', | ||
'( "EFC416C7C53A81E7363BE6C1A389131A", blob(one-keep-one-remove) )', | ||
'( "FF76830FF90D79BB335884F256031731", blob(edit-v2) )', | ||
] | ||
|
||
[[]] | ||
type = 'table' | ||
tbl_name = 'map' | ||
sql = ''' | ||
CREATE TABLE map ( | ||
zoom_level integer NOT NULL, | ||
tile_column integer NOT NULL, | ||
tile_row integer NOT NULL, | ||
tile_id text, | ||
PRIMARY KEY(zoom_level, tile_column, tile_row))''' | ||
values = [ | ||
'( 5, 0, 0, "51037A4A37730F52C8732586D3AAA316" )', | ||
'( 5, 0, 1, "FF76830FF90D79BB335884F256031731" )', | ||
'( 5, 1, 0, "22AF645D1859CB5CA6DA0C484F1F37EA" )', | ||
'( 6, 0, 0, "51037A4A37730F52C8732586D3AAA316" )', | ||
'( 6, 0, 1, "03132BFACDB00CC63D6B7DD98D974DD5" )', | ||
'( 6, 1, 4, "EFC416C7C53A81E7363BE6C1A389131A" )', | ||
'( 6, 1, 6, "22AF645D1859CB5CA6DA0C484F1F37EA" )', | ||
] | ||
|
||
[[]] | ||
type = 'table' | ||
tbl_name = 'metadata' | ||
sql = ''' | ||
CREATE TABLE metadata ( | ||
name text NOT NULL PRIMARY KEY, | ||
value text)''' | ||
values = [ | ||
'( "agg_tiles_hash", "5364C57282B73C341D5D801B8F7675C4" )', | ||
'( "md-edit", "value - v2" )', | ||
'( "md-new", "value - new" )', | ||
'( "md-same", "value - same" )', | ||
] | ||
|
||
[[]] | ||
type = 'index' | ||
tbl_name = 'images' | ||
|
||
[[]] | ||
type = 'index' | ||
tbl_name = 'map' | ||
|
||
[[]] | ||
type = 'index' | ||
tbl_name = 'metadata' | ||
|
||
[[]] | ||
type = 'view' | ||
tbl_name = 'tiles' | ||
sql = ''' | ||
CREATE VIEW tiles AS | ||
SELECT map.zoom_level AS zoom_level, | ||
map.tile_column AS tile_column, | ||
map.tile_row AS tile_row, | ||
images.tile_data AS tile_data | ||
FROM map | ||
JOIN images ON images.tile_id = map.tile_id''' | ||
[[]] | ||
type = 'view' | ||
tbl_name = 'tiles_with_hash' | ||
sql = ''' | ||
CREATE VIEW tiles_with_hash AS | ||
SELECT | ||
map.zoom_level AS zoom_level, | ||
map.tile_column AS tile_column, | ||
map.tile_row AS tile_row, | ||
images.tile_data AS tile_data, | ||
images.tile_id AS tile_hash | ||
FROM map | ||
JOIN images ON images.tile_id = map.tile_id''' |