Questions tagged [planetscale]

Planet Scale is a MySQL compatible hosted database as a service

72 questions
0
votes
0 answers

How to create a MySQL connection using Ag-Grid and Next.js?

While opening a database connection to a Planetscale MYSQL database using node.js, I encountered the following error : TypeError: Converting circular structure to JSON --> starting at object with constructor 'Query' | property '_timer'…
0
votes
0 answers

How to read a Prisma Model with sql

I am following a youtube tutorial, and this is the first time ive used Prisma. My simple question is, what is the difference if you do for example: store Store @relation("StoreToCategory", fields: [storeId], references: [id]) vs billboard…
0
votes
2 answers

Many to many relationship or one to many with a separate pivot table?

Table clients can have many users. 99.9% of users belong to only one client. But there is a special type of user (auditors) that can “belong” to multiple clients. Should I model this as a many to many relationship via a pivot table between the…
bennythemink
  • 5,096
  • 4
  • 36
  • 54
0
votes
0 answers

Long running queries with Prisma on Planetscale timeout

It would appear that Planetscale will timeout after 20s and stop the query. (also sometimes happens on Vercel's Postgres as well) Error occurred during query execution: ConnectorError(ConnectorError { user_facing_error: None, kind:…
schmell
  • 50
  • 8
0
votes
1 answer

Data migration : from postgreSQL (Azure ) to planetscale

I need to migrate my data from postgreSQL (Azure ) to planetscale which is Mysql based , i have set up my planet scale , along side the schemas . What should i be be doing next ?
Suksham
  • 36
  • 5
0
votes
0 answers

How to change timezone in planetscale

I'm currently using mysql base online database service, 'Planet Scale'. But having trouble on changing timezone. I tried to set timezone by using following query in Planet Scale online console. ` SET GLOBAL time_zone = '+9:00'; SET time_zone =…
qubic
  • 1
  • 1
0
votes
0 answers

Planetscale, Prisma relationmode complex error

I'm using Next Auth, so I want to create a Clan model, that also contains Users. But I'm getting mapping error. I've always used foreignKeys, so I think I don't understand how this relationModel = prisma works. Could you give me an example or tell…
LansPeti
  • 153
  • 5
0
votes
1 answer

@planetscale/database produces an error with drizzle (in Hapi, with ts-node) in Node.js

I am using Drizzle ORM and Planetscale. Connecting to Planetscale I get an error: Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/@planetscale/database/dist/index.js from src/database/connect.ts not supported. Instead change the…
0
votes
0 answers

how to export database connection in nuxt 3

I want to use drizzle ORM to connect my PlanetScale database I am using nuxt.js 3. Should I put this code provided by drizzle ORM into the nuxt plugin folder? const connection = connect({ host: process.env["DATABASE_HOST"], username:…
seki
  • 19
  • 3
0
votes
1 answer

Laravel Planetscale can migrate but can't query it show SQLSTATE[HY000] [2002]

I'm having a bit of trouble with my Laravel version 8.0 and PlanetScale connection. I've got everything configured in my .env file, including the certificate installation, and I can migrate tables to the database just fine. However, when I try to…
Yato
  • 25
  • 1
  • 3
0
votes
1 answer

`FOREIGN KEY` on PlanetScale

I want to deploy a Django app on Vercel which uses PlanetScale as database. But since PlanetScale does not support foreign key and the Django works heavily with this constraint. So my question is there is any way that solves this problem ? I tried…
0
votes
0 answers

Local development with planetscale DB and Laravel, Laravel Valet

Maybe I'm doing something wrong but when developing locally (Laravel Valet, Laravel) it feels unresponsive/slow it always takes about 2 seconds till the first bite transfer. My internet connection is not an issue here 100%. I settled everything…
RomkaLTU
  • 3,683
  • 8
  • 40
  • 63
0
votes
0 answers

No way to connect to Planetscale from PHP PDO or MySQLi not working

Its impossible to connect to Planetscale cloud Mysql DB from PHP. I try with mysqli doing : $hostname = "secret"; $dbName = "secret"; $port = "3306"; $ssl = "/etc/ssl/certs/ca-certificates.crt"; …
Johna Pop
  • 11
  • 4
0
votes
0 answers

Issue WIth ACID Compliant Transaction With Flask-SqlAlchemy

As per Flask-SqlAlchemy Docs: * You may see uses of Model.query to build queries. This is an older interface for queries that is considered legacy in SQLAlchemy. Prefer using db.session.execute(db.select(...)) instead.* I want to perform a batch…
0
votes
0 answers

Invalid `prisma.user.create()` invocation when using Patreon Adapter for NextAuth.js

I am trying to use the NextAuth/Auth.js Patreon Adapter and am able to at least display the sign in button however, after authenticating with Patreon, I get an error during the callback. prisma:error Invalid `prisma.user.create()` invocation: The…
Flakenstine
  • 25
  • 1
  • 9