Vision2023
Vision2023
Explore posts from servers
DTDrizzle Team
Created by Vision2023 on 5/29/2024 in #help
Type error when using subquery in where
No description
2 replies
TTCTheo's Typesafe Cult
Created by Vision2023 on 4/25/2024 in #questions
Should I report a bug to a federal(-ish) university without hopes of a bug bounty?
I live in nigeria, I attend national open university of nigeria. I recently found out a bug which allowed me to register all my courses without payment(I.E Basically attend the university for free), change stuff like number of credit units(which allows me to take on infinite courses, register courses I shouldn't have access to and stuff like that. There is prolly more (given their terribly designed api) but I didn't look further. I'm wandering whether I should report the bug since I dont know if I have hopes of a bug bounty. P.S I really need money rn so looking for any way to get some.
2 replies
TTCTheo's Typesafe Cult
Created by Vision2023 on 4/12/2024 in #questions
How to fix jupyterhub issue
Anyone have any experience with jupyterhub? I'm getting: TimeoutError: pod jupyterhub/jupyter-zfjryuibwedbvgjvmxrvjcfjybevht did not start in 300 seconds! With config
# This file can update the JupyterHub Helm chart's default configuration values.
#
# For reference see the configuration reference and default values, but make
# sure to refer to the Helm chart version of interest to you!
#
# Introduction to YAML: https://www.youtube.com/watch?v=cdLNKUoMc6c
# Chart config reference: https://zero-to-jupyterhub.readthedocs.io/en/stable/resources/reference.html
# Chart default values: https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/HEAD/jupyterhub/values.yaml
# Available chart versions: https://hub.jupyter.org/helm-chart/
#
proxy:
secretToken: tuFslOftLZF2t7ECEUZeMgmfOaIdv1RX

debug:
enabled: true

singleuser:
defaultUrl: "/lab"
extraEnv:
JUPYTERHUB_SINGLEUSER_APP: jupyter_server.serverapp.ServerApp
JUPYTERHUB_ADMIN: admin
memory:
limit: 6G
guarantee: 512M
cpu:
limit: 2
guarantee: .5
image:
name: jupyter/datascience-notebook
tag: latest

hub:
services:
datarango:
admin: true
name: datarango
api_token: secret-token

extraConfig:
myConfig.py: |
c.JupyterHub.authenticator_class = CustomNullAuthenticator
# This file can update the JupyterHub Helm chart's default configuration values.
#
# For reference see the configuration reference and default values, but make
# sure to refer to the Helm chart version of interest to you!
#
# Introduction to YAML: https://www.youtube.com/watch?v=cdLNKUoMc6c
# Chart config reference: https://zero-to-jupyterhub.readthedocs.io/en/stable/resources/reference.html
# Chart default values: https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/HEAD/jupyterhub/values.yaml
# Available chart versions: https://hub.jupyter.org/helm-chart/
#
proxy:
secretToken: tuFslOftLZF2t7ECEUZeMgmfOaIdv1RX

debug:
enabled: true

singleuser:
defaultUrl: "/lab"
extraEnv:
JUPYTERHUB_SINGLEUSER_APP: jupyter_server.serverapp.ServerApp
JUPYTERHUB_ADMIN: admin
memory:
limit: 6G
guarantee: 512M
cpu:
limit: 2
guarantee: .5
image:
name: jupyter/datascience-notebook
tag: latest

hub:
services:
datarango:
admin: true
name: datarango
api_token: secret-token

extraConfig:
myConfig.py: |
c.JupyterHub.authenticator_class = CustomNullAuthenticator
2 replies
DTDrizzle Team
Created by Vision2023 on 3/18/2024 in #help
AWS data api error in transactions
Basically here's the aurora issue progress: I want to run concurrent db requests(Promise.all) to aws-data-api in transactions: E.G
const createdProducts = await db.transaction(async (tx): Promise<RandomType> => {
await Promise.all(
_.chunk(
productOptions.map((productOption): typeof products.$inferInsert => ({
...productOption,
productSetId,
userId: req.user.userId
})),
500
).map(async (productsChunk) => tx.insert(products).values(productsChunk))
);
})
const createdProducts = await db.transaction(async (tx): Promise<RandomType> => {
await Promise.all(
_.chunk(
productOptions.map((productOption): typeof products.$inferInsert => ({
...productOption,
productSetId,
userId: req.user.userId
})),
500
).map(async (productsChunk) => tx.insert(products).values(productsChunk))
);
})
However, it returns this error: DatabaseErrorException: Transaction is still running a query Its like this for all Promise.all inside the transaction What I've tried: Applying different patches to drizzle-orm (from people's prs fixing data-api transaction issues) - Didn't work Made the request synchronous - Worked Making it concurrent without promise.all(didn't work) Reducing (by >100x) the amount of requests that were made (didn't work for bigger payloads. It appears to work with regular updating with the maxed out options, however it doesn't work with sth like create where I can't optimise away the amount of queries) By reduced, I mean I reduced from about 15,020 queries to 2 queries in one of the promise.all and 30,000 to 2 also.(in my scenario) Messing around with delays etc(also didn't work)
2 replies
DTDrizzle Team
Created by Vision2023 on 3/11/2024 in #help
How to use nested joins with relational query builder
I have a query like this:
const templates = await db.query.productSetTemplates.findMany({
limit: 12,
offset: /* not important */,
orderBy: /* not important */,
where: /* not important */,
with: {
productSet: {
with: {
products: {
limit: 1
}
}
},
prototypeProductSets: {
with: {
products: {
columns: {
id: true
}
}
}
}
}
})
const templates = await db.query.productSetTemplates.findMany({
limit: 12,
offset: /* not important */,
orderBy: /* not important */,
where: /* not important */,
with: {
productSet: {
with: {
products: {
limit: 1
}
}
},
prototypeProductSets: {
with: {
products: {
columns: {
id: true
}
}
}
}
}
})
I want to transform it to use relational query builder. I'm having problem with nested joins. How do I do this. I want to use rqb because, I have to make another query somewhere else and i think I shouldn't need to make that extra query if I use rqb.
1 replies
DTDrizzle Team
Created by Vision2023 on 2/24/2024 in #help
How do I publish a fork of the repo to npm
I've been trying to publish a fork of drizzle-orm to npm but I keep getting
npm ERR! code EUSAGE
npm ERR! Automatic provenance generation not supported for provider: null

npm ERR! A complete log of this run can be found in: /Users/visiononyeaku/.npm/_logs/2024-02-24T18_58_04_265Z-debug-0.log
npm ERR! code EUSAGE
npm ERR! Automatic provenance generation not supported for provider: null

npm ERR! A complete log of this run can be found in: /Users/visiononyeaku/.npm/_logs/2024-02-24T18_58_04_265Z-debug-0.log
When running:
$ npm run pack
$ npm run publish
$ npm run pack
$ npm run publish
in drizzle-orm folder.
4 replies
DTDrizzle Team
Created by Vision2023 on 2/19/2024 in #help
An issue when creating string[] elements
I'm getting an error: DatabaseErrorException: ERROR: column "images" is of type text[] but expression is of type text; Hint: You will need to rewrite or cast the expression. For the following code:
const newListings = []
const newListing = {
images: [...Array(8)].map(() => faker.image.url()),
...others
};
newListings.push(newListing)
await db.insert(listings).values(newListings)
const newListings = []
const newListing = {
images: [...Array(8)].map(() => faker.image.url()),
...others
};
newListings.push(newListing)
await db.insert(listings).values(newListings)
I'm using aws rds data api
50 replies
DTDrizzle Team
Created by Vision2023 on 1/2/2024 in #help
Drizzle-kit push:pg not working
I can't run npx drizzle-kit push:pg. I'm using an aws rds database with manage_master_user_password = true. My drizzle config: export default { dbCredentials: { database: 'ecominatestagingdb', host: 'ecominate-staging-db.**.us-east-1.rds.amazonaws.com', port: 5432 }, driver: 'pg', out: './drizzle', schema: './src/schema.ts' } satisfies Config; npx drizzle-kit push:pg outputs: drizzle-kit: v0.20.9 drizzle-orm: v0.29.2 No config path provided, using default path Reading config file '/Users/visiononyeaku/Desktop/Work/rip-technologies/packages/ecominate/database/drizzle.config.ts' node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^ Error: connect ETIMEDOUT 172.31..:5432 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17) { errno: -60, code: 'ETIMEDOUT', syscall: 'connect', address: '172.31...*', port: 5432 } Node.js v21.5.0
17 replies