Comments (4)
To pinpoint: Does it work without
/8
, just a pure IP address?
Yes. It works with a regular IP, without the mask.
from prisma.
ping @RrredHead
from prisma.
To pinpoint: Does it work without /8
, just a pure IP address?
from prisma.
As a workaround, for single insertion:
const subnet = "0.0.0.0/8";
await prisma.$executeRaw`
INSERT INTO "Subnet" ("subnet")
VALUES ${Prisma.sql`(${subnet}::INET)`}
ON CONFLICT DO NOTHING;
`;
For multiple insertion:
await prisma.$executeRaw`
INSERT INTO "Subnet" ("subnet")
VALUES ${Prisma.join(
data.map((row) => Prisma.sql`(${row.subnet}::INET`),
', ',
)}
ON CONFLICT DO NOTHING;
`;
Note that I had to change the id column so postgresql generates it and I can run raw queries without worrying about it.
model Subnet {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
subnet String @db.Inet
}
from prisma.
Related Issues (20)
- Sort by property of `Json` field HOT 1
- Error: Could not parse schema engine response: SyntaxError: Unexpected token '/', "/data/data"... is not valid JSON HOT 2
- npx prisma generate gives the download error
- @prisma/extension-pulse is not exported from package HOT 6
- Disambiguating relations incorrectly auto formatting HOT 7
- Many-to-many relationship not through linking table
- Raw query returning a bigint for an int field HOT 1
- error Command "up" not found. HOT 1
- Repeated alter migrations in Postgres for `String[] @default([]) @db.VarChar(64)`
- In "prisma" mode, executing prisma db pull results in the loss of generated fields.
- Dynamic load relations
- Error Thrown When Sorting Field Is Not Selected HOT 3
- ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "42P05", message: "prepared statement \"s0\" already exists", severity: "ERROR", detail: None, column: None, hint: None }), transient: false })]
- How to Perform Group By with Date Extraction in Prisma
- Unable to require libquery_engine-debian-openssl-3.0.x.so.node HOT 2
- Hello @bso-oo 👋 HOT 2
- Run Prisma on docker use elysia/Bun js HOT 1
- Inconsistent column data: Malformed ObjectID: provided hex string representation must be exactly 12 bytes, instead got HOT 2
- Support for manually managing prepared statements HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prisma.