Documente Academic
Documente Profesional
Documente Cultură
Desktop Application
● Web application RDBMS
SQL
? Resultset
Browser HTTP
MQL-to-SQL: a JSON-based Query language for your RDBMS
Project: http://code.google.com/p/mql-to-sql/
Contact: http://rpbouman.blogspot.com - @rolandbouman
The Data Access Problem
● Build a service
– Protocol on top of HTTP: REST, RPC
– Data format: JSON, XML
● Advantage: controlled data access
● Disadvantage: controlled=limited
SQL SQL
JSON Resultset
Film_Actor:
Film Key
Actor Key
MQL-to-SQL: a JSON-based Query language for your RDBMS
Project: http://code.google.com/p/mql-to-sql/
Contact: http://rpbouman.blogspot.com - @rolandbouman
SQL can't escape the RM
header
Header
– line 1a
– line 2b Split off line 1a
– multivalued attributes line 2b
– repeating groups
Unnormalized data First normal form (1NF)
??? Remove
redundancy
line 1a
header
line 2b
header line 1a
header line 2b SQL queries: 1
– JOIN operation 2
Denormalized data (1NF) Higher normal forms (>= 3NF)
MQL-to-SQL: a JSON-based Query language for your RDBMS
Project: http://code.google.com/p/mql-to-sql/
Contact: http://rpbouman.blogspot.com - @rolandbouman
SQL can't escape the RM
Language:
language_name
Film:
title
Category: description Actor:
release_year
name length last_name
rating first_name
Film_Category: Film_Actor:
$metadata_file_name = '';
...code...
?> ?>
MQL-to-SQL: a JSON-based Query language for your RDBMS
Project: http://code.google.com/p/mql-to-sql/
Contact: http://rpbouman.blogspot.com - @rolandbouman
MQL-to-SQL metadata file
{
"domains": {
"sakila": {
"schema_name": "",
"types": {
"actor": {
"properties": {
"actor_id": {
"column_name": "actor_id",
"nullable": false,
"type": "/type/int"
},
"starring_in": {
"type": "/sakila/film_actor",
"direction": "referenced<-referencing",
"join_condition": [
{
"referencing_column": "actor_id",
"referenced_column": "actor_id"
},