anyhowstep
10/29/2019, 5:46 PMnikolasburk
nikolasburk
nikolasburk
anyhowstep
10/29/2019, 5:55 PMfloat?
I think all 4 databases support double. And SQLite and Mongo only have double, I think. Or is that left over legacy stuff? =x
/nitpicknikolasburk
Globolobo
10/29/2019, 6:01 PMtimestamptz converted to a dateTime scalar type.
Apologies for hijacking the thread, just seemed very relevant.anyhowstep
10/29/2019, 6:03 PMT only supported by DB A, B and not C, D. And that's dangerous. But then, The user only uses DB A, B, anyway. So, even though it's clunky and possibly unsafe in the general case, for specific cases, it's fine.anyhowstep
10/29/2019, 6:06 PManyhowstep
10/29/2019, 6:10 PMMatt Mueller (Prisma Client PM)
Matt Mueller (Prisma Client PM)
Like, if they use unsigned bigint with MySQL and postgresql, theyâre gonna run into problems because postgresql doesnât have unsigned bigint. But itâll be fine if they donât accidentally go over the signed bigint limit.
Or like with decimal. Itâs fine as long as they stay within MySQLâs constraints (max 65 for precision, 30 for scale) and Postgresqlâs constraints (min 1 for precision)this is exactly the problem weâre trying to resolve. we could gloss over the details and say an int is perhaps an int64, but maybe some datasources donât support it. so we need to get more granular with our data types. for the common SQL flavors, youâll have a pretty consistent set of âStandard Typesâ, so String, Int, Float, etc, that will map to
text, integer, float4, etc.Matt Mueller (Prisma Client PM)
That spec for loosening guarantees kind of scares me a little. So does the best effort thing.what part scares you? đ maybe the spec wasnât clear because from my perspective your examples motivate making the guarentees looser đ
Matt Mueller (Prisma Client PM)
anyhowstep
10/31/2019, 4:50 PMis your library public?https://github.com/AnyhowStep/tsql Still needs a lot of work (naming, features, adapter libraries, documentation, etc.), but a bunch of stuff already works. 1. Clone 2.
npm install
3. npm run sanity-check (Should build and run tests)anyhowstep
10/31/2019, 4:52 PMweâre saying that not every datasource implements... say a Float.Ah. Okay, that makes more sense. So, if they try to use an unsupported data type for a data source, throw a compile-time, or run-time error (hopefully have both)?
anyhowstep
10/31/2019, 4:53 PMMatt Mueller (Prisma Client PM)
Matt Mueller (Prisma Client PM)
Matt Mueller (Prisma Client PM)
anyhowstep
10/31/2019, 4:58 PManyhowstep
10/31/2019, 4:59 PMMatt Mueller (Prisma Client PM)
Matt Mueller (Prisma Client PM)
anyhowstep
10/31/2019, 5:05 PMSELECT user.someValue + 50 in SQL.
However, I did see expressions in the "where" clause.
where: {
OR: [
{ title: { contains: 'GraphQL' } },
{ title: { contains: 'REST' } }
],
published: true,
},
So, I'm curious how simple/complex these expressions can be, and deeply nested they can get.
Are correlated subqueries a thing?
Are type casting expressions a thing?
Are joins a thing?
Can expressions reference properties/columns from multiple tables/entities?
etc.Matt Mueller (Prisma Client PM)
Matt Mueller (Prisma Client PM)
Matt Mueller (Prisma Client PM)
(u, x) => x.coalesce(u.firstName, u.lastName)anyhowstep
10/31/2019, 5:17 PMSTRCMP() is MySQL-specific. PostgreSQL does not have it.
SIMILAR_TO is PostgreSQL-specific. MySQL does not have it.
Regexes are handled differently across MongoDB, MySQL, PostgreSQL.Matt Mueller (Prisma Client PM)
strcmp for mysql, turn it off for postgres.Matt Mueller (Prisma Client PM)
anyhowstep
10/31/2019, 5:33 PManyhowstep
10/31/2019, 5:33 PManyhowstep
10/31/2019, 5:33 PManyhowstep
10/31/2019, 5:34 PManyhowstep
10/31/2019, 5:37 PM(schema, data source) pairs.
And mine requires `npm install`ing a separate "adapter" library for each data source a user wants.
So, lots of overlap.
My project will probably stay SQL-focused and not be as ambitious as Prisma's, though.