-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0.1.2 adds MongoDB support, more databases in future
- Loading branch information
1 parent
a3f3861
commit acc47d8
Showing
9 changed files
with
116 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
declare class Mongo { | ||
private client; | ||
connect(url: string): Promise<void>; | ||
getCollection(db: string, col: string): Promise<any>; | ||
getDatabase(db: string): Promise<any>; | ||
update(db: string, col: string, query: any, update: any): Promise<any>; | ||
insert(db: string, col: string, data: any): Promise<any>; | ||
find(db: string, col: string, query: any): Promise<any[]>; | ||
findOne(db: string, col: string, query: any): Promise<any>; | ||
delete(db: string, col: string, query: any): Promise<any>; | ||
close(): Promise<void>; | ||
} | ||
declare class MongoService { | ||
private static instance; | ||
constructor(); | ||
static getInstance(): Mongo; | ||
} | ||
export default MongoService; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
import { SendJSON, Success, Failure, ServerFailure, Redirect, Html } from "./helpers/helper.ts"; | ||
import { query } from "./helpers/query.ts"; | ||
import { param } from "./helpers/param.ts"; | ||
import { SendJSON, Success, Failure, ServerFailure, Redirect, Html } from "../helpers/helper.ts"; | ||
import { query } from "../helpers/query.ts"; | ||
import { param } from "../helpers/param.ts"; | ||
import MongoService from "../instances/mongodb.ts"; | ||
declare class ProBun { | ||
private port; | ||
private routes; | ||
private logger; | ||
private mongoUri; | ||
constructor(props: { | ||
port: number; | ||
routes: string; | ||
logger: boolean; | ||
mongoUri?: any; | ||
}); | ||
start(): void; | ||
start(): Promise<void>; | ||
definePreMiddleware(middleware: any): void; | ||
definePostMiddleware(middleware: any): void; | ||
} | ||
export { ProBun, SendJSON, Success, Failure, ServerFailure, Redirect, Html, query, param }; | ||
export { ProBun, SendJSON, Success, Failure, ServerFailure, Redirect, Html, query, param, MongoService }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.