Posted to tcl by schelte at Wed Jul 12 15:31:07 GMT 2017view raw
- puts [package require sqlite3]
- proc bla {data} {
- after 200 [list [info coroutine]]
- yield
- }
- sqlite3 db :memory:
- db function bla bla
- db eval {
- create table foo (
- data text
- );
- create temp trigger insert_foo after insert on foo
- begin
- select bla(new.data);
- end;
- }
- coroutine main try {
- db eval {insert into foo values('something')}
- } on error {str opts} {
- puts stderr [dict get $opts -errorinfo]
- } finally {
- exit
- }
- vwait forever
- Produces:
- 3.13.0
- cannot yield: C stack busy
- while executing
- "yield"
- (procedure "bla" line 3)
- invoked from within
- "bla something"
- invoked from within
- "db eval {insert into foo values('something')}"
- ("try" body line 2)