
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
@psibean/typeorm-provider
Advanced tools
Note: I've shifted to my PrismaProvider
I'm using TypeORM with discord.js and discord-akairo, since discord-akairo does not yet natively support a TypeORM provider, I made this one! Nothing special, all I did was copy the SequelizeProvider and update it to use a TypeORM Repository instead.
Feel free to use this and make changes, happy to accept pull requests if I've messed something up or overlooked / misunderstood something.
Ensure you have TypeORM, discord.js, and discord-akairo already installed.
npm install @psibean/typeorm-provider
import { TypeORMProvider } from '@psibean/typeorm-provider';
const { TypeORMProvider } = require('@psibean/typeorm-provider');
provider = new
TypeORMProvider(
connection.get(connectionName).getRepository(Entity),
{ idColumn: "id",
dataColumn: "jsonColumnName"
});
One other difference between this provider and the other providers is set, which can take a defaultData value for when it has to create a new record:
provider.set(id, key, value, defaultData = { "one": true, "two": "someValue" });
If there is no record for the provided id, then a new record will be created that looks like:
{ "one": true, "two": "someValue", [key]: value }
If the provided key matches one of the keys in the defaultData the passed value will overwrite the default.
It otherwise works the same as the other providers, the only difference is instead of taking the actual model / entity, it takes the repository instead.
FAQs
A TypeORM based provider for discord-akairo.
We found that @psibean/typeorm-provider demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.