mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Tests for unit filtering
This commit is contained in:
parent
3c985ec271
commit
ed974417ad
2 changed files with 38 additions and 2 deletions
|
|
@ -79,6 +79,12 @@ METADATA = {
|
|||
'no_primary_key': {
|
||||
'sortable_columns': [],
|
||||
},
|
||||
'units': {
|
||||
'units': {
|
||||
'distance': 'm',
|
||||
'frequency': 'Hz'
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
@ -155,6 +161,16 @@ CREATE TABLE "complex_foreign_keys" (
|
|||
FOREIGN KEY ("f3") REFERENCES [simple_primary_key](id)
|
||||
);
|
||||
|
||||
CREATE TABLE units (
|
||||
pk integer primary key,
|
||||
distance int,
|
||||
frequency int
|
||||
);
|
||||
|
||||
INSERT INTO units VALUES (1, 1, 100);
|
||||
INSERT INTO units VALUES (2, 5000, 2500);
|
||||
INSERT INTO units VALUES (3, 100000, 75000);
|
||||
|
||||
CREATE TABLE [select] (
|
||||
[group] text,
|
||||
[having] text,
|
||||
|
|
@ -189,7 +205,6 @@ CREATE VIEW simple_view AS
|
|||
).replace('None', 'null') for row in generate_sortable_rows(201)
|
||||
])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
filename = sys.argv[-1]
|
||||
if filename.endswith('.db'):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue