Oreki
Oreki
Explore posts from servers
XXata
Created by Oreki on 7/6/2024 in #help
Cursor Pagination Broken
Hii, i am facing an error with cursor pagination where i get this error when i use the cursor to paginate through the after and before fields
cursor invalid: filter invalid: column [character-\u003eelement]: invalid identifier, column [character-\u003eelement]: invalid identifier, offset 10: invalid symbol [\], only alphanumerics and '-', '_', or '~' are allowed
cursor invalid: filter invalid: column [character-\u003eelement]: invalid identifier, column [character-\u003eelement]: invalid identifier, offset 10: invalid symbol [\], only alphanumerics and '-', '_', or '~' are allowed
this happens when i use filter on JSON nested key character->element
10 replies
XXata
Created by Oreki on 6/9/2024 in #help
Transactions API
i'm using typescript SDK, in the transactions API, it appears to be not accepting any other types except primitive types, to create a new record with json column, i need to pass json object in a stringified version apparently for it to work
25 replies
XXata
Created by Oreki on 3/8/2024 in #help
Drizzle integration not working anymore
Hey guys, the update 0.29.5 of drizzle-orm broke the SDK as the class PreparedQuery was renamed to PgPreparedQuery and the xata implementation still uses the old name.
4 replies
DTDrizzle Team
Created by Oreki on 1/26/2024 in #help
advanced relational query builder
hey, i have a use case where i need to return rows from one table based on filters requiring on connected table here's prisma equivalent code
await prisma.card.findMany({
where: {
// character is another table
character: {
element: '...'
}
}
})
await prisma.card.findMany({
where: {
// character is another table
character: {
element: '...'
}
}
})
how would this be possible with drizzle
13 replies
TtRPC
Created by Oreki on 1/21/2024 in #❓-help
'react-server-dom-webpack/client' error
Hey, i am trying to get started with TRPC but getting this error
../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/client/components/router-reducer/fetch-server-response.js
Module not found: Can't resolve 'react-server-dom-webpack/client'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/client/components/router-reducer/reducers/navigate-reducer.js
../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/client/components/router-reducer/router-reducer.js
../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/shared/lib/router/action-queue.js
../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/client/components/use-reducer-with-devtools.js
../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/client/components/app-router.js
../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/client/app-call-server.js
../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/build/webpack/loaders/next-flight-loader/action-client-wrapper.js
./src/lib/trpc/index.ts
./src/pages/_app.tsx
../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/client/components/router-reducer/fetch-server-response.js
Module not found: Can't resolve 'react-server-dom-webpack/client'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/client/components/router-reducer/reducers/navigate-reducer.js
../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/client/components/router-reducer/router-reducer.js
../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/shared/lib/router/action-queue.js
../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/client/components/use-reducer-with-devtools.js
../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/client/components/app-router.js
../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/client/app-call-server.js
../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/build/webpack/loaders/next-flight-loader/action-client-wrapper.js
./src/lib/trpc/index.ts
./src/pages/_app.tsx
2 replies
CDCloudflare Developers
Created by Oreki on 9/15/2023 in #workers-help
ENV Variables not found
hello, i am using hono, i have two routes one is list and other is image
import { Hono } from 'hono/quick';
import { createClient } from '@supabase/supabase-js';

type Bindings = {
SUPABASE_URL: string;
SUPABASE_KEY: string;
TOKEN: string;
};

const app = new Hono<{ Bindings: Bindings }>();

// Routes
app.get('/image', async (context) => {
const { env } = context

console.log(env);
if (!env || !env.SUPABASE_URL || !env.SUPABASE_KEY) {
return context.json({ error: true, message: 'Environment not found' }, 500);
}

try {
// ....
} catch (error) {
if (error instanceof Error) {
console.log(error);
return context.json({ error: true, message: error.message }, 500);
}
}
});

app.get('/list', async (context) => {
const { env } = context;
if (!env || !env.SUPABASE_URL || !env.SUPABASE_KEY) {
return context.json({ error: true, message: 'Environment not found' }, 500);
}

const key = context.req.query('key');
if (!key || context.env.TOKEN !== key) {
return context.json({ error: true, message: 'Invalid token' }, 401);
}

try {
// ...
} catch (error) {
if (error instanceof Error) {
console.log(error);
return context.json({ error: true, message: error.message }, 500);
}
}
});

export default app;
import { Hono } from 'hono/quick';
import { createClient } from '@supabase/supabase-js';

type Bindings = {
SUPABASE_URL: string;
SUPABASE_KEY: string;
TOKEN: string;
};

const app = new Hono<{ Bindings: Bindings }>();

// Routes
app.get('/image', async (context) => {
const { env } = context

console.log(env);
if (!env || !env.SUPABASE_URL || !env.SUPABASE_KEY) {
return context.json({ error: true, message: 'Environment not found' }, 500);
}

try {
// ....
} catch (error) {
if (error instanceof Error) {
console.log(error);
return context.json({ error: true, message: error.message }, 500);
}
}
});

app.get('/list', async (context) => {
const { env } = context;
if (!env || !env.SUPABASE_URL || !env.SUPABASE_KEY) {
return context.json({ error: true, message: 'Environment not found' }, 500);
}

const key = context.req.query('key');
if (!key || context.env.TOKEN !== key) {
return context.json({ error: true, message: 'Invalid token' }, 401);
}

try {
// ...
} catch (error) {
if (error instanceof Error) {
console.log(error);
return context.json({ error: true, message: error.message }, 500);
}
}
});

export default app;
when i try to access to the route /list everything works fine a supabase client is intialised and im returned number of files i have but when i go to route image i get the error that Environment not found and when i log the env it seems to be an empty object
3 replies
CDCloudflare Developers
Created by Oreki on 9/9/2023 in #pages-help
PNPM Monorepo on cloudflare pages
hello, i have a pnpm monorepo using lerna, i would like to deploy one of the apps to cloudflare pages from my monorepo heres my build configuration
Build command: pnpm install --force && cd apps/cdn && npx @cloudflare/next-on-pages@1
Build output directory: /apps/cdn/.vercel/output/static
Root directory: /
Build command: pnpm install --force && cd apps/cdn && npx @cloudflare/next-on-pages@1
Build output directory: /apps/cdn/.vercel/output/static
Root directory: /
the issue is that i cannot cd into the correct directory and its running the npx @cloudflare/next-on-pages@1 at root directory and build is failing for the same reason
6 replies
DTDrizzle Team
Created by Oreki on 8/7/2023 in #help
relations help
how can i have a many-to-many relation for example a user can have multiple followers and can follow multple users
export const users = pgTable(
'users',
{
id: text('id').primaryKey().notNull(),
name: text('name'),
bio: text('bio').default("I Don''t Need A Bio, I''m A Developer"),
email: text('email'),
avatar: text('avatar').default('https://i.imgur.com/6VBx3io.png'),
bannerImage: text('bannerImage').default('https://i.imgur.com/6VBx3io.png'),
createdAt: timestamp('created_at', { precision: 3, mode: 'string' }).defaultNow().notNull(),
updatedAt: timestamp('updated_at', { precision: 3, mode: 'string' }).notNull(),
role: role('role'),
preferences: jsonb('preferences'),
auth: jsonb('auth'),
invitedBy: text('invitedBy'),
},
(table) => {
return {
emailKey: uniqueIndex('users_email_key').on(table.email),
};
},
);

export const userRelations = relations(users, ({ one, many }) => ({
invitee: one(users, {
fields: [users.invitedBy],
references: [users.id],
}),
// followers: many(users, {
// relationName: 'followers',
// }),
// following: many(users, {
// relationName: 'following',
// }),
posts: many(post),
comments: many(comment),
likes: many(like),
}));
export const users = pgTable(
'users',
{
id: text('id').primaryKey().notNull(),
name: text('name'),
bio: text('bio').default("I Don''t Need A Bio, I''m A Developer"),
email: text('email'),
avatar: text('avatar').default('https://i.imgur.com/6VBx3io.png'),
bannerImage: text('bannerImage').default('https://i.imgur.com/6VBx3io.png'),
createdAt: timestamp('created_at', { precision: 3, mode: 'string' }).defaultNow().notNull(),
updatedAt: timestamp('updated_at', { precision: 3, mode: 'string' }).notNull(),
role: role('role'),
preferences: jsonb('preferences'),
auth: jsonb('auth'),
invitedBy: text('invitedBy'),
},
(table) => {
return {
emailKey: uniqueIndex('users_email_key').on(table.email),
};
},
);

export const userRelations = relations(users, ({ one, many }) => ({
invitee: one(users, {
fields: [users.invitedBy],
references: [users.id],
}),
// followers: many(users, {
// relationName: 'followers',
// }),
// following: many(users, {
// relationName: 'following',
// }),
posts: many(post),
comments: many(comment),
likes: many(like),
}));
this seem to not work and im told to give more information about relation "user.followers"
2 replies