()
| 1051 | } |
| 1052 | |
| 1053 | func (s *AdapterTests) Test_Issue409_TxOptions() { |
| 1054 | sess := s.Session() |
| 1055 | |
| 1056 | { |
| 1057 | err := sess.TxContext(context.Background(), func(tx db.Session) error { |
| 1058 | col := tx.Collection("publication") |
| 1059 | |
| 1060 | row := map[string]interface{}{ |
| 1061 | "title": "foo", |
| 1062 | "author_id": 1, |
| 1063 | } |
| 1064 | err := col.InsertReturning(&row) |
| 1065 | s.Error(err) |
| 1066 | |
| 1067 | return err |
| 1068 | }, &sql.TxOptions{ |
| 1069 | ReadOnly: true, |
| 1070 | }) |
| 1071 | s.Error(err) |
| 1072 | s.True(strings.Contains(err.Error(), "read-only transaction")) |
| 1073 | } |
| 1074 | } |
| 1075 | |
| 1076 | func (s *AdapterTests) TestEscapeQuestionMark() { |
| 1077 | sess := s.Session() |
nothing calls this directly
no test coverage detected