Skip to content

Commit

Permalink
Merge pull request #36 from melohagan/fix/exported-member-knex
Browse files Browse the repository at this point in the history
Fix index.ts
  • Loading branch information
emurphy authored Jun 1, 2022
2 parents 9b0f63d + 5bd9d0c commit 1a941c7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 29 deletions.
6 changes: 1 addition & 5 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import * as Bluebird from "bluebird";
import * as Knex from "knex";
import { Knex } from "knex";
import { QueryCompiler } from "./query/QueryCompiler";
import { SchemaCompiler, TableCompiler } from "./schema";
export declare class SnowflakeDialect extends Knex.Client {
constructor(config?: any);
// @ts-ignore
get dialect(): string;
// @ts-ignore
get driverName(): string;
transaction(container: any, config: any, outerTx: any): Knex.Transaction;
queryCompiler(builder: any): QueryCompiler;
columnBuilder(tableBuilder: any, type: any, args: any): any;
Expand Down
17 changes: 7 additions & 10 deletions lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"snowflake-sdk": "1.6.0"
},
"peerDependencies": {
"knex": "^0.15.2"
"knex": "1.0.3"
},
"devDependencies": {
"@types/bluebird": "3.5.29",
Expand All @@ -66,7 +66,7 @@
"@types/node": "13.7.0",
"chai": "4.2.0",
"jest": "25.1.0",
"knex": "0.20.4",
"knex": "1.0.3",
"mocha": "7.1.1",
"mysql": "2.18.1",
"sinon": "9.0.1",
Expand Down
19 changes: 7 additions & 12 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import * as Bluebird from "bluebird";
import * as Knex from "knex";
import { Knex } from "knex";
import { defer, fromPairs, isArray, map, toPairs } from "lodash";

import { QueryCompiler } from "./query/QueryCompiler";
import { SchemaCompiler, TableCompiler } from "./schema";
import * as ColumnBuilder from "knex/lib/schema/columnbuilder";
import * as ColumnCompiler_MySQL from "knex/lib/dialects/mysql/schema/columncompiler";
import * as Transaction from "knex/lib/transaction";
import * as ColumnCompiler_MySQL from "knex/lib/dialects/mysql/schema/mysql-columncompiler";
import * as Transaction from "knex/lib/execution/transaction";
import { promisify } from "util";

export class SnowflakeDialect extends Knex.Client {
constructor(config = {} as any) {
constructor(config = {
dialect: "snowflake",
driverName: "snowflake-sdk",
} as any) {
if (config.connection) {
if (config.connection.user && !config.connection.username) {
config.connection.username = config.connection.user;
Expand All @@ -28,14 +31,6 @@ export class SnowflakeDialect extends Knex.Client {
super(config);
}

public get dialect() {
return "snowflake";
}

public get driverName() {
return "snowflake-sdk";
}

transaction(container: any, config: any, outerTx: any): Knex.Transaction {
const transax = new Transaction(this, container, config, outerTx);
transax.savepoint = (conn: any) => {
Expand Down

0 comments on commit 1a941c7

Please sign in to comment.