Lion
Lion
Explore posts from servers
RRailway
Created by Lion on 3/24/2024 in #✋|help
using a private github container registry image with railway
how do I authenticate with the github container registry to allow me to use a private container image from the registry? I'm using railways option to deploy a docker container.
7 replies
KKysely
Created by Lion on 1/1/2024 in #help
TS2345: Argument of type  "id"  is not assignable to parameter of type  ReferenceExpression<Database
Code:
const newToken = await db
.selectFrom("tokens")
.selectAll()
.where("id", "=", token.insertId)
.$narrowType<Token>()
.executeTakeFirst();
const newToken = await db
.selectFrom("tokens")
.selectAll()
.where("id", "=", token.insertId)
.$narrowType<Token>()
.executeTakeFirst();
Schema File:
import { ColumnType, Generated, Selectable } from "kysely";
import { TokenType } from "./lib/token";

export interface Database {
tokens: TokenType;
}

export interface TokenTable {
id: Generated<Number>;

secret: string;
description: string;
type: TokenType;

created_at: ColumnType<Date, string | undefined, never>;
}

export type Token = Selectable<TokenTable>;
import { ColumnType, Generated, Selectable } from "kysely";
import { TokenType } from "./lib/token";

export interface Database {
tokens: TokenType;
}

export interface TokenTable {
id: Generated<Number>;

secret: string;
description: string;
type: TokenType;

created_at: ColumnType<Date, string | undefined, never>;
}

export type Token = Selectable<TokenTable>;
TokenType Enum (incase it matters):
export enum TokenType {
ADMIN,
SERVER,
CLIENT,
}
export enum TokenType {
ADMIN,
SERVER,
CLIENT,
}
The code is giving me a typescript error for the first argument of the where clause, "id":
TS2345: Argument of type  "id"  is not assignable to parameter of type  ReferenceExpression<Database, "tokens"> 
TS2345: Argument of type  "id"  is not assignable to parameter of type  ReferenceExpression<Database, "tokens"> 
10 replies