47ng / 47ng/prisma-field-encryption

Disable warning: could not find a field to use to iterate over rows in model ___

Aperta
#103 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
306
Fork
40
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hello!

I'm using this plugin in on a model where I unique with `@@unique([created_at, cf_ray, request_num])`. This table is in the database is actually partitioned on created_at /daily using timescaledb so I cannot have another column as PK, unless I lie in the schema and change in the production model

So, I would appreciate if I have a way to disable the warning, or a way to implement a workarround

```
console.warn
[prisma-field-encryption] Warning: could not find a field to use to iterate over rows in model api_request_log.
Automatic encryption/decryption/key rotation migrations are disabled for this model.
Read more: https://github.com/47ng/prisma-field-encryption#migrations
```

I've tried using the @encryption:cursor, but it as well only has the same limitation as with the @id field, so it do not accept compound fields

schema, if need, to reproduce the log message:

```sql
model api_request_log {
created_at DateTime @default(now()) @db.Timestamp(6)
cf_ray String
request_num Int

ip String @db.Inet
response_time Int
response_size Int
req_method String
req_path String
req_host String
req_headers String /// @encrypted?mode=strict
req_query String /// @encrypted?mode=strict
req_body String /// @encrypted?mode=strict
req_body_size Int?
res_code Int @db.SmallInt
created_customer_id Int?

@@unique([created_at, cf_ray, request_num])
}
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.