

select * into /t001 from /matrix/ldap
;

select * into /t002 from /matrix/group
;

{
"sql": "SELECT * FROM /t001; SELECT * FROM T_t002;",
"class": ["/t001","/t002"]
}
/**
output()
**/
;

{
"sql": "SELECT * FROM T_t002",
"class": ["/t002"]
}
/**
output()
**/
;

{
"sql": "SELECT t001.username,t002.fullname,t001.grpset,t002.member,t001.email FROM T_t001 t001 JOIN T_t002 t002 ON exists (select 1 from json_each(t001.grpset) where value=t002.fullname)",
"class": ["/t001", "/t002"]
}
/**
output()
**/
;

{
"sql": "SELECT t001.username,t002.fullname,t001.grpset,t002.member,t001.email FROM /t001 t001 JOIN /t002 t002 ON exists (select 1 from json_each(t001.grpset) where value=t002.fullname)"
}
/**
output()
**/
;

{
"sql": "SELECT * INTO T_t003 FROM /t002",
"class": ["/t001", "/t002"]
}
/**
onerror(continue, "syntax error")
output()
**/
;

{
"sql": "INSERT INTO T_t003 SELECT * FROM /t002",
"class": ["/t001", "/t002"]
}
/**
onerror(ignore, 'no such table')
output()
**/
;
