/[sudobot]/trunk/src/client/Database.ts
ViewVC logotype

Contents of /trunk/src/client/Database.ts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 342 - (show annotations)
Mon Jul 29 17:29:39 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: application/typescript
File size: 503 byte(s)
refactor(db): use mongodb
1 import { Sequelize } from 'sequelize';
2 import { Database as DB } from 'sqlite3';
3 import DiscordClient from './Client';
4 import mongoose from "mongoose";
5
6 export default class Database {
7 client: DiscordClient;
8 dbpath: string;
9
10 constructor(dbpath: string, client: DiscordClient) {
11 this.client = client;
12 this.dbpath = dbpath;
13
14 mongoose.connect(process.env.MONGO_URI!)
15 .then(() => console.log("Connected to MongoDB"))
16 .catch(console.error);
17 }
18 }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26