This repository has been archived by the owner on Mar 18, 2022. It is now read-only.
forked from typeorm/typeorm
-
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.
feat: Aurora Data API (typeorm#4375)
* Initial POC Implementation * Initial POC Implementation * Implemented an interface transformation between typeorm and data api so most of the queries should work, added some tests * Fixed lint errors * Fixed a regex and added some tests on query transformation * Move out to a separate repo * Bumped aurora driver version to latest * Bumped aurora driver version to latest * Delegate transactions to the driver * Delegate transactions to the driver * WIP * WIP * Bump the aurora driver version * Bump the aurora driver version * Fixed aurora driver version * removed unused entity
- Loading branch information
1 parent
b4e9cf0
commit c321562
Showing
10 changed files
with
2,555 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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,20 @@ | ||
import {AuroraDataApiQueryRunner} from "./AuroraDataApiQueryRunner"; | ||
import {Connection} from "../../connection/Connection"; | ||
import {ConnectionOptions, QueryRunner} from "../.."; | ||
|
||
/** | ||
* Organizes communication with MySQL DBMS. | ||
*/ | ||
export class AuroraDataApiConnection extends Connection { | ||
queryRunnter: AuroraDataApiQueryRunner; | ||
|
||
constructor(options: ConnectionOptions, queryRunner: AuroraDataApiQueryRunner) { | ||
super(options); | ||
this.queryRunnter = queryRunner; | ||
} | ||
|
||
public createQueryRunner(mode: "master" | "slave" = "master"): QueryRunner { | ||
return this.queryRunnter; | ||
} | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
src/driver/aurora-data-api/AuroraDataApiConnectionCredentialsOptions.ts
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,43 @@ | ||
/** | ||
* MySQL specific connection credential options. | ||
* | ||
* @see https://github.com/mysqljs/mysql#connection-options | ||
*/ | ||
export interface AuroraDataApiConnectionCredentialsOptions { | ||
|
||
/** | ||
* Connection url where perform connection to. | ||
*/ | ||
readonly url?: string; | ||
|
||
/** | ||
* Database host. | ||
*/ | ||
readonly host?: string; | ||
|
||
/** | ||
* Database host port. | ||
*/ | ||
readonly port?: number; | ||
|
||
/** | ||
* Database username. | ||
*/ | ||
readonly username?: string; | ||
|
||
/** | ||
* Database password. | ||
*/ | ||
readonly password?: string; | ||
|
||
/** | ||
* Database name to connect to. | ||
*/ | ||
readonly database?: string; | ||
|
||
/** | ||
* Object with ssl parameters or a string containing name of ssl profile. | ||
*/ | ||
readonly ssl?: any; | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
src/driver/aurora-data-api/AuroraDataApiConnectionOptions.ts
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,23 @@ | ||
import {BaseConnectionOptions} from "../../connection/BaseConnectionOptions"; | ||
import {AuroraDataApiConnectionCredentialsOptions} from "./AuroraDataApiConnectionCredentialsOptions"; | ||
|
||
/** | ||
* MySQL specific connection options. | ||
* | ||
* @see https://github.com/mysqljs/mysql#connection-options | ||
*/ | ||
export interface AuroraDataApiConnectionOptions extends BaseConnectionOptions, AuroraDataApiConnectionCredentialsOptions { | ||
|
||
/** | ||
* Database type. | ||
*/ | ||
readonly type: "aurora-data-api"; | ||
|
||
readonly region: string; | ||
|
||
readonly secretArn: string; | ||
|
||
readonly resourceArn: string; | ||
|
||
readonly database: string; | ||
} |
Oops, something went wrong.