| 1 |
|
| MODULE = DBIx::Loop PACKAGE = DBIx::Loop::Txn |
| 2 |
|
| |
| 3 |
|
| PROTOTYPES: DISABLE |
| 4 |
|
| |
| 5 |
|
| # $tx->query($sql, @bind) -> future, pinned to the transaction's slot |
| 6 |
|
| SV * |
| 7 |
|
| query(self, sql, ...) |
| 8 |
|
| SV *self |
| 9 |
|
| SV *sql |
| 10 |
|
| CODE: |
| 11 |
|
| { |
| 12 |
3 |
| AV *bind = (AV *)sv_2mortal((SV *)newAV()); |
| 13 |
|
| int i; |
| 14 |
3 |
▶ | for (i = 2; i < items; i++) av_push(bind, newSVsv(ST(i))); |
Branch: 1 branch
| Branch | True | False | Total |
| for (i = 2; i < items; i++) av_push(bind, newSVsv(ST(i))); |
0 |
3 |
3 |
|
| 15 |
3 |
| RETVAL = dbil_txn_stmt(aTHX_ self, 1, sql, bind); |
| 16 |
|
| } |
| 17 |
|
| OUTPUT: |
| 18 |
|
| RETVAL |
| 19 |
|
| |
| 20 |
|
| # $tx->do($sql, @bind) -> future, pinned to the transaction's slot |
| 21 |
|
| SV * |
| 22 |
|
| do(self, sql, ...) |
| 23 |
|
| SV *self |
| 24 |
|
| SV *sql |
| 25 |
|
| CODE: |
| 26 |
|
| { |
| 27 |
16 |
| AV *bind = (AV *)sv_2mortal((SV *)newAV()); |
| 28 |
|
| int i; |
| 29 |
38 |
▶ | for (i = 2; i < items; i++) av_push(bind, newSVsv(ST(i))); |
Branch: 1 branch
| Branch | True | False | Total |
| for (i = 2; i < items; i++) av_push(bind, newSVsv(ST(i))); |
22 |
16 |
38 |
|
| 30 |
16 |
| RETVAL = dbil_txn_stmt(aTHX_ self, 0, sql, bind); |
| 31 |
|
| } |
| 32 |
|
| OUTPUT: |
| 33 |
|
| RETVAL |
| 34 |
|
| |
| 35 |
|
| int |
| 36 |
|
| is_active(self) |
| 37 |
|
| SV *self |
| 38 |
|
| CODE: |
| 39 |
1 |
▶ | RETVAL = dbil_tx_iv(aTHX_ self, "active") == 1; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = dbil_tx_iv(aTHX_ self, "active") == 1; |
0 |
1 |
1 |
|
| 40 |
|
| OUTPUT: |
| 41 |
|
| RETVAL |