When using a raw Expression consider using the table-prefix before the table name if the table name is hardcoded
I have table names prefixed with 'kp_' and pulse throws the following exception:
#18 {main}An exception happened in PulseSQLSTATE[42P01]: Undefined table: 7 ERROR: missing FROM-clause entry for table "pulse_aggregates"
LINE 1: ... "aggregate", "key_hash") do update set "value" = "pulse_agg...
^ (Connection: pgsql, SQL: insert into "kp_pulse_aggregates" ("aggregate", "bucket", "key", "period", "type", "value") values (count, 1717076700, ["select count(*) as aggregate from \"kp_migrations\"","C:\\Software\\kp\\api\\vendor\\laravel\\pulse\\src\\Pulse.php:594"], 60, slow_query, 1), (count, 1717076520, ["select count(*) as aggregate from \"kp_migrations\"","C:\\Software\\kp\\api\\vendor\\laravel\\pulse\\src\\Pulse.php:594"], 360, slow_query, 1), (count, 1717076160, ["select count(*) as aggregate from \"kp_migrations\"","C:\\Software\\kp\\api\\vendor\\laravel\\pulse\\src\\Pulse.php:594"], 1440, slow_query, 1), (count, 1717067520, ["select count(*) as aggregate from \"kp_migrations\"","C:\\Software\\kp\\api\\vendor\\laravel\\pulse\\src\\Pulse.php:594"], 10080, slow_query, 1) on conflict ("bucket", "period", "type", "aggregate", "key_hash") do update set "value" = "pulse_aggregates"."value" + "excluded"."value")
avoid this behavior by using $this->connection()->getTablePrefix() just before the table name in src/Storage/DatabaseStorage.php
Pulse Version
v1.2.1
Laravel Version
11.8.0
PHP Version
8.2.12
Livewire Version
3.5.0
Database Driver & Version
Postgres 13
Description
I don't know if this can be considered a bug ...
When using a raw Expression consider using the table-prefix before the table name if the table name is hardcoded I have table names prefixed with 'kp_' and pulse throws the following exception:
avoid this behavior by using
$this->connection()->getTablePrefix()
just before the table name insrc/Storage/DatabaseStorage.php
Eg.
Regards S.
Steps To Reproduce
Put in .env
DB_PREFIX=kp_