1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-02-09 12:14:03 +02:00
pocketbase/tests/logs.go

36 lines
589 B
Go
Raw Normal View History

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