Closed SuspensionPoint closed 1 year ago
Hm, I can't reproduce this:
PS C:\Users\Jan\Documents\throwaway\14369> node .\script.js
Created new: {
createdAt: 2022-07-30T19:56:08.063Z,
week: null,
team: 'NYG',
stats: {
gp: 18,
rec: 58,
rec_fd: 43.4,
rec_td: 2,
rec_yd: 434,
adp_2qb: 36.5,
adp_idp: 36.7,
adp_ppr: 22.3,
adp_std: 22.3,
pts_ppr: 264.5,
pts_std: 206.5,
rec_0_4: 11.6,
rec_40p: 5.8,
rec_5_9: 11.6,
rush_fd: 107.1,
rush_td: 8,
rush_yd: 1071,
fum_lost: 2,
rush_att: 246,
rec_10_19: 17.4,
rec_20_29: 11.6,
rec_30_39: 5.8,
adp_rookie: 999,
adp_dynasty: 999,
adp_half_ppr: 20.1,
bonus_rec_rb: 58,
pts_half_ppr: 235.5,
adp_dynasty_2qb: 41.4,
adp_dynasty_ppr: 29.4,
adp_dynasty_std: 31,
adp_dynasty_half_ppr: 29.3
},
sport: 'nfl',
season_type: 'regular',
season: '2022',
player_id: '4866',
player: {
team: 'NYG',
metadata: { injury_override_regular_2021_6: 'Out' },
position: 'RB',
last_name: 'Barkley',
years_exp: 4,
first_name: 'Saquon',
injury_notes: null,
news_updated: 1656295812160,
injury_status: null,
injury_body_part: null,
fantasy_positions: [ 'RB' ],
injury_start_date: null
},
opponent: null,
game_id: 'season',
date: null,
company: 'rotowire',
category: 'proj'
}
All [
{
createdAt: 2022-07-30T19:54:52.853Z,
week: null,
team: 'NYG',
stats: {
gp: 18,
rec: 58,
rec_fd: 43.4,
rec_td: 2,
rec_yd: 434,
adp_2qb: 36.5,
adp_idp: 36.7,
adp_ppr: 22.3,
adp_std: 22.3,
pts_ppr: 264.5,
pts_std: 206.5,
rec_0_4: 11.6,
rec_40p: 5.8,
rec_5_9: 11.6,
rush_fd: 107.1,
rush_td: 8,
rush_yd: 1071,
fum_lost: 2,
rush_att: 246,
rec_10_19: 17.4,
rec_20_29: 11.6,
rec_30_39: 5.8,
adp_rookie: 999,
adp_dynasty: 999,
adp_half_ppr: 20.1,
bonus_rec_rb: 58,
pts_half_ppr: 235.5,
adp_dynasty_2qb: 41.4,
adp_dynasty_ppr: 29.4,
adp_dynasty_std: 31,
adp_dynasty_half_ppr: 29.3
},
sport: 'nfl',
season_type: 'regular',
season: '2022',
player_id: '4866',
player: {
team: 'NYG',
metadata: [Object],
position: 'RB',
last_name: 'Barkley',
years_exp: 4,
first_name: 'Saquon',
injury_notes: null,
news_updated: 1656295812160,
injury_status: null,
injury_body_part: null,
fantasy_positions: [Array],
injury_start_date: null
},
opponent: null,
game_id: 'season',
date: null,
company: 'rotowire',
category: 'proj'
}
]
with this script:
const { PrismaClient } = require('@prisma/client')
const prisma = new PrismaClient()
async function main() {
const newFoo = await prisma.PlayerProjection.create({
data: {
week: null,
team: 'NYG',
stats: {
rush_yd: 1071,
rush_td: 8,
rush_fd: 107.1,
rush_att: 246,
rec_yd: 434,
rec_td: 2,
rec_fd: 43.4,
rec_5_9: 11.6,
rec_40p: 5.8,
rec_30_39: 5.8,
rec_20_29: 11.6,
rec_10_19: 17.4,
rec_0_4: 11.6,
rec: 58,
pts_std: 206.5,
pts_ppr: 264.5,
pts_half_ppr: 235.5,
gp: 18,
fum_lost: 2,
bonus_rec_rb: 58,
adp_std: 22.3,
adp_rookie: 999,
adp_ppr: 22.3,
adp_idp: 36.7,
adp_half_ppr: 20.1,
adp_dynasty_std: 31,
adp_dynasty_ppr: 29.4,
adp_dynasty_half_ppr: 29.3,
adp_dynasty_2qb: 41.4,
adp_dynasty: 999,
adp_2qb: 36.5
},
sport: 'nfl',
season_type: 'regular',
season: '2022',
player_id: '4866',
player: {
years_exp: 4,
team: 'NYG',
position: 'RB',
news_updated: 1656295812160,
metadata: { injury_override_regular_2021_6: 'Out' },
last_name: 'Barkley',
injury_status: null,
injury_start_date: null,
injury_notes: null,
injury_body_part: null,
first_name: 'Saquon',
fantasy_positions: [ 'RB' ]
},
opponent: null,
game_id: 'season',
date: null,
company: 'rotowire',
category: 'proj'
},
})
console.log(`Created new: `, newFoo)
const allFoo = await prisma.playerProjection.findMany()
console.log('All', allFoo)
}
main()
.then(async () => {
await prisma.$disconnect()
})
.catch(async (e) => {
console.error(e)
await prisma.$disconnect()
process.exit(1)
})
and schema:
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
model PlayerProjection {
createdAt DateTime @default(now())
week String?
team String
stats Json
sport String
season_type String
season String
player_id String @id
player Json
opponent String?
game_id String
date String?
company String
category String
}
Am I doing something wrong than you?
I am using a AWS RDS MySQL running version 5.7.33-log
.
(Running Prisma 4.1.1)
Ping @SuspensionPoint Can you please take a look at my reproduction? We want to take a look at this and fix it. But right now we do not know what is broken.
Can you help us out here @SuspensionPoint? With the current information we unfortunately will need to close the issue as it is not enough to understand what is going on and reproduce it. Thanks!
Closing then until someone provides more information. Please comment or open a new issue. Thanks!
FWIW, for anyone else who landed here by googling, I got this error too and the solution was indeed that the size of the stored JSON is too large
. At different points in testing I saw the column names for
and =
in error messages.
Bug description
I'm getting this error when trying to create values of the following schema:
Schema:
Error:
The last section where it's suggesting that it's failing on column_name 'for' is throwing me off, because there is not column with that name in the schema.
My only guess is that the size of the stored JSON is too large, but even then I'm not sure.
How to reproduce
Using the provided environment and Prisma info, try and create a value of the provided schema.
Expected behavior
I'm expecting the create to work and add the values to the DB or at least give an error that is easily interpretable, although I'm sure it's user error.
Prisma information
Environment & setup
Prisma Version