v3: updated demo to showcase new features

This commit is contained in:
Sugu Sougoumarane 2016-02-13 12:11:05 -08:00
Родитель 29b9cd6c29
Коммит 7cb32582dd
1 изменённых файлов: 12 добавлений и 6 удалений

Просмотреть файл

@ -24,14 +24,10 @@ function DemoController($scope, $http) {
"delete from user where name='test1' /* error: cannot delete by non-unique vindex */",
"",
"insert into user_extra(user_id, extra) values(1, 'extra1')",
"insert into user_extra(user_id, extra) values(2, 'test1')",
"insert into user_extra(user_id, extra) values(6, 'test2')",
"insert into user_extra(extra) values('extra1') /* error: must supply value for user_id */",
"select user_id, extra from user_extra where extra='extra1' /* scatter */",
"select u.user_id, u.name, e.user_id, e.extra from user u join user_extra e on u.user_id = e.user_id where u.user_id = 1 /* simple, single row join */",
"select u.user_id, u.name, e.user_id, e.extra from user u join user_extra e on u.user_id = e.user_id /* simple, scatter join */",
"select u.user_id, u.name, e.user_id, e.extra from user u join user_extra e on u.name != e.extra where u.user_id = 1 /* simple, cross-shard complex join */",
"select u1.user_id, u1.name, u2.user_id, u2.name from user u1 join user u2 on u1.name = u2.name where u1.user_id = 1 /* self-join */",
"select u.user_id, u.name, e.user_id, e.extra from user u left join user_extra e on u.user_id = e.user_id /* left join */",
"select u.user_id, u.name, e.user_id, e.extra from user u left join user_extra e on u.name != e.extra where u.user_id = 1 /* cross-shard left join */",
"update user_extra set extra='extra2' where user_id=1 /* allowed */",
"delete from user_extra where user_id=1 /* vindexes are unchanged */",
"",
@ -41,6 +37,16 @@ function DemoController($scope, $http) {
"delete from music where music_id=6 /* one row deleted */",
"delete from music where user_id=1 /* multiple rows deleted */",
"",
"select u.user_id, u.name, e.user_id, e.extra from user u join user_extra e on u.user_id = e.user_id where u.user_id = 2 /* simple, single row join */",
"select u.user_id, u.name, e.user_id, e.extra from user u join user_extra e on u.user_id = e.user_id /* simple, scatter join */",
"select u.user_id, u.name, e.user_id, e.extra from user u join user_extra e on u.name != e.extra where u.user_id = 2 /* simple, cross-shard complex join */",
"select u1.user_id, u1.name, u2.user_id, u2.name from user u1 join user u2 on u1.name = u2.name where u1.user_id = 2 /* self-join */",
"select u.user_id, u.name, e.user_id, e.extra from user u left join user_extra e on u.user_id = e.user_id /* left join */",
"select u.user_id, u.name, e.user_id, e.extra from user u left join user_extra e on u.name != e.extra where u.user_id = 2 /* cross-shard left join */",
"select user_id, name from user where name in (select extra from user_extra where user_id = user.user_id) /* correlated subquery */",
"select count(*), u.user_id, u.name, e.extra from user u join user_extra e on u.user_id = e.user_id /* aggregates */",
"select u.user_id, u.name, m.music_id, m.user_id from user u join music m on u.user_id = m.music_id where u.user_id = 1 order by u.user_id, u.name, m.user_id /* order by, in spite of odd join */",
"",
"insert into music_extra(music_id) values(1) /* keyspace_id back-computed */",
"insert into music_extra(music_id, keyspace_id) values(1, 1) /* invalid keyspace id */",
];