pocketbase/tests/logs.go

36 lines
589 B
Go
Raw Normal View History

2022-07-07 05:19:05 +08:00
package tests
2023-11-26 19:33:17 +08:00
func MockLogsData(app *TestApp) error {
2022-07-07 05:19:05 +08:00
_, err := app.LogsDB().NewQuery(`
2023-11-26 19:33:17 +08:00
delete from {{_logs}};
2022-07-07 05:19:05 +08:00
2023-11-26 19:33:17 +08:00
insert into {{_logs}} (
2022-07-07 05:19:05 +08:00
[[id]],
2023-11-26 19:33:17 +08:00
[[level]],
[[message]],
[[data]],
2022-07-07 05:19:05 +08:00
[[created]],
[[updated]]
)
values
(
"873f2133-9f38-44fb-bf82-c8f53b310d91",
2023-11-26 19:33:17 +08:00
0,
"test_message1",
'{"status":200}',
2022-10-30 16:28:14 +08:00
"2022-05-01 10:00:00.123Z",
"2022-05-01 10:00:00.123Z"
2022-07-07 05:19:05 +08:00
),
(
"f2133873-44fb-9f38-bf82-c918f53b310d",
2023-11-26 19:33:17 +08:00
8,
"test_message2",
'{"status":400}',
2022-10-30 16:28:14 +08:00
"2022-05-02 10:00:00.123Z",
"2022-05-02 10:00:00.123Z"
2022-07-07 05:19:05 +08:00
);
`).Execute()
return err
}