Jackson Kasi
Jackson Kasi
Explore posts from servers
DTDrizzle Team
Created by Jackson Kasi on 10/22/2024 in #help
Issue: Error during `db:push` - TypeError in Drizzle Kit with PostgreSQL
No description
3 replies
DTDrizzle Team
Created by Jackson Kasi on 8/17/2024 in #help
Issue with drizzle-graphql Entities Not Working Well with GraphQL
No description
3 replies
DTDrizzle Team
Created by Jackson Kasi on 8/17/2024 in #help
Help Needed: Error with Arguments in GraphQL Resolver Using Drizzle ORM, Serverless, and TypeScript
Hi Drizzle Community, I'm running into an issue with GraphQL and Drizzle ORM while working on a serverless project using TypeScript. I've set up my environment with the following key components: - Environment: Serverless Framework - Language: TypeScript - ORM: Drizzle ORM - GraphQL: Apollo Server with @apollo/server - Database: PostgreSQL (using drizzle-orm/postgres-js) Problem Description I'm encountering the following error when trying to run my serverless application:
✖ Unhandled exception in handler 'server'.
✖ Query.userProfile args must be an object with argument names as keys.
Error: Query.userProfile args must be an object with argument names as keys.
at devAssert (...\graphql\jsutils\devAssert.js:12:11)
at ...\graphql\type\definition.js:793:32
...
✖ Unhandled exception in handler 'server'.
✖ Query.userProfile args must be an object with argument names as keys.
Error: Query.userProfile args must be an object with argument names as keys.
at devAssert (...\graphql\jsutils\devAssert.js:12:11)
at ...\graphql\type\definition.js:793:32
...
Context Here’s a simplified version of my code setup: user.schema.ts:
import { GraphQLObjectType, GraphQLNonNull, GraphQLString } from "graphql";
import { drizzleEntities } from "@/db";
import { getUserProfile } from "./services/getUserProfile.service";

const userQuery = new GraphQLObjectType({
name: "UserQuery",
fields: {
userProfile: {
type: drizzleEntities.types.UsersItem,
args: {
authUserId: { type: new GraphQLNonNull(GraphQLString) },
},
resolve: async (_, args) => {
console.log(args);
const { authUserId } = args;
return getUserProfile(authUserId);
},
},
},
});

export { userQuery };
import { GraphQLObjectType, GraphQLNonNull, GraphQLString } from "graphql";
import { drizzleEntities } from "@/db";
import { getUserProfile } from "./services/getUserProfile.service";

const userQuery = new GraphQLObjectType({
name: "UserQuery",
fields: {
userProfile: {
type: drizzleEntities.types.UsersItem,
args: {
authUserId: { type: new GraphQLNonNull(GraphQLString) },
},
resolve: async (_, args) => {
console.log(args);
const { authUserId } = args;
return getUserProfile(authUserId);
},
},
},
});

export { userQuery };
5 replies
DTDrizzle Team
Created by Jackson Kasi on 8/16/2024 in #help
Help Needed: `UnhandledSchemeError: cloudflare:sockets` with Drizzle ORM and `runtime = "edge"`
Hi Drizzle community, I'm running into a problem while trying to deploy my Next.js API routes using Drizzle ORM with PostgreSQL. Everything works fine locally, but when I set export const runtime = "edge";, I encounter the following error during compilation:
⨯ cloudflare:sockets
Module build failed: UnhandledSchemeError: Reading from "cloudflare:sockets" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "cloudflare:" URIs.
Import trace for requested module:
cloudflare:sockets
./node_modules/.pnpm/[email protected]/node_modules/postgres/cf/polyfills.js
./node_modules/.pnpm/[email protected]/node_modules/postgres/cf/src/index.js
./src/db/index.ts
./src/app/api/[[...route]]/routes/register/index.ts
./src/app/api/[[...route]]/routes/index.ts
./src/app/api/[[...route]]/route.ts
⨯ cloudflare:sockets
Module build failed: UnhandledSchemeError: Reading from "cloudflare:sockets" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "cloudflare:" URIs.
Import trace for requested module:
cloudflare:sockets
./node_modules/.pnpm/[email protected]/node_modules/postgres/cf/polyfills.js
./node_modules/.pnpm/[email protected]/node_modules/postgres/cf/src/index.js
./src/db/index.ts
./src/app/api/[[...route]]/routes/register/index.ts
./src/app/api/[[...route]]/routes/index.ts
./src/app/api/[[...route]]/route.ts
My Setup: - Framework: Next.js - Database: PostgreSQL - ORM: Drizzle ORM with postgres package - Runtime: edge (Cloudflare Workers) - Key Code Snippet:
import { env } from "@/config/env";
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";

import * as schema from "./schema";

const client = postgres(env.DATABASE_URL);
export const db = drizzle(client, { schema, logger: true });

import { env } from "@/config/env";
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";

import * as schema from "./schema";

const client = postgres(env.DATABASE_URL);
export const db = drizzle(client, { schema, logger: true });

Issue Summary: The error seems to stem from the postgres package when trying to use the edge runtime with Cloudflare Workers. It appears that Webpack cannot handle the cloudflare: scheme used in postgres/cf/polyfills.js. Questions: 1. Has anyone else encountered this problem when using Drizzle ORM with Cloudflare Workers and the runtime = "edge" setting? 2. Is there a recommended approach for using Drizzle ORM with PostgreSQL in Cloudflare Workers? Any advice or suggestions would be greatly appreciated! Thanks in advance for your help!
1 replies
KKinde
Created by Jackson Kasi on 7/16/2024 in #💻┃support
Are there guidelines for integrating Kind Auth with a React.js-based Figma plugin?
No description
3 replies
DTDrizzle Team
Created by Jackson Kasi on 6/30/2024 in #help
Issue with Drizzle ORM and drizzle-kit push with Tembo Cloud PostgreSQL
No description
3 replies
DTDrizzle Team
Created by Jackson Kasi on 5/11/2024 in #help
Handling Aggregated Counts with GroupBy in Drizzle ORM: Requesting Community Insights
No description
2 replies
HHono
Created by Jackson Kasi on 5/2/2024 in #help
Seeking Guidance: Transitioning from Hono.js with Cloudflare Workers to AWS Lambda
Hello, guys! Does anyone have a project that combines Hono.js with AWS Lambda? Please share it here. It would be helpful for me to work with this tech stack. I have worked with Hono.js and Cloudflare Workers, and it's really fast. However, some npm packages do not support edge computing. Therefore, I am planning to switch my upcoming project to AWS. ( hono js + aws lambda ) However, due to the lack of documentation, I am unable to work with Hono.js on AWS Lambda, and there is no option to run the server locally. So, if anyone could share the repository or any article or provide guidance, I would appreciate it.
3 replies
DTDrizzle Team
Created by Jackson Kasi on 4/20/2024 in #help
Need Help: `ilike` Function Not Returning Expected Results in Drizzle ORM
Hello Drizzle ORM Community! I'm currently working with Drizzle ORM in a TypeScript environment using PostgreSQL (specifically, Neon PostgreSQL) and I've encountered a small issue with querying user data using the ilike function for case-insensitive matching. I'm attempting to query tbl_users based on partial user names, but I'm not getting the expected results. Here's the snippet of my code where I implement the query:
const usersList = await db.query.tbl_users.findMany({
where: ilike(tbl_users.full_name, input.query), // todo: need to fix.
columns: {
full_name: true,
email: true,
},
});
const usersList = await db.query.tbl_users.findMany({
where: ilike(tbl_users.full_name, input.query), // todo: need to fix.
columns: {
full_name: true,
email: true,
},
});
I pass the query parameter as jack expecting to retrieve users with names like Jackson Kasi, but instead, I receive an empty array. According to the Drizzle ORM documentation, the ilike should work for PostgreSQL like so:
import { ilike } from "drizzle-orm";
db.select().from(table).where(ilike(table.column, "%llo wor%"));
import { ilike } from "drizzle-orm";
db.select().from(table).where(ilike(table.column, "%llo wor%"));
However, my current implementation doesn't seem to function as expected. Does anyone have experience with this function or can spot what I might be doing wrong? Any suggestions on how to properly use ilike with findMany or corrections to my approach would be greatly appreciated! Thank you in advance for your help!
3 replies
DTDrizzle Team
Created by Jackson Kasi on 4/18/2024 in #help
Help with SQL_PARSE_ERROR When Using Raw SQL Queries in Drizzle ORM with Sqlite ( truso db )
No description
1 replies
DTDrizzle Team
Created by Jackson Kasi on 4/10/2024 in #help
Issue Querying Table via Drizzle ORM with SQLite
No description
15 replies
RRailway
Created by Jackson Kasi on 8/29/2023 in #✋|help
Access Railway server via http, not https?
Hello guys, any one can let me know to access my railway server using http link? ex: http://myserver.up.railway.app
8 replies
RRailway
Created by Jackson Kasi on 10/25/2022 in #✋|help
how to connect GitLab project in railway app ( auto deploy as like GitHub )
If i push my code to gitlap, railway app should want to auto deploy my new code from gitlap. how can i do it? #✋|help
3 replies