Skip to content

Commit

Permalink
HCK-8703: hckFetch (#53)
Browse files Browse the repository at this point in the history
* feat: replaced HttpHandler with our own @hackolade/fetch encapsulation

* chore: bump client-glue to the latest
  • Loading branch information
chulanovskyi-bs authored Nov 8, 2024
1 parent 9de1eb8 commit 0e4dd3d
Show file tree
Hide file tree
Showing 6 changed files with 524 additions and 614 deletions.
6 changes: 3 additions & 3 deletions forward_engineering/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const { get } = require('lodash');
const { GlueClient, CreateDatabaseCommand, CreateTableCommand, GetDatabasesCommand } = require('@aws-sdk/client-glue');
const { hckFetchAwsSdkHttpHandler } = require('@hackolade/fetch');
const { getDatabaseStatement } = require('./helpers/databaseHelper');
const { getTableStatement } = require('./helpers/tableHelper');
const { getIndexes } = require('./helpers/indexHelper');
Expand All @@ -10,7 +11,6 @@ const { getGlueDatabaseCreateStatement } = require('./helpers/awsCliScriptHelper
const { getGlueTableCreateStatement } = require('./helpers/awsCliScriptHelpers/glueTableHelper');
const { getApiStatements } = require('./helpers/awsCliScriptHelpers/applyToInstanceHelper');
const sqlFormatter = require('./custom_modules/sql-formatter');
const { HttpHandler } = require('../shared/httpHandler/httpHandler');

module.exports = {
generateScript(data, logger, callback) {
Expand Down Expand Up @@ -186,9 +186,9 @@ const buildAWSCLIModelScript = (containerData, tablesSchemas = {}) => {
return composeCLIStatements([dbStatement, ...tablesStatements]);
};

const getGlueInstance = ({ connectionInfo, logger }) => {
const getGlueInstance = ({ connectionInfo }) => {
const { accessKeyId, secretAccessKey, region, sessionToken, queryRequestTimeout } = connectionInfo;
const httpHandler = new HttpHandler({ logger, requestTimeout: queryRequestTimeout });
const httpHandler = hckFetchAwsSdkHttpHandler({ requestTimeout: queryRequestTimeout });

return new GlueClient({
region,
Expand Down
Loading

0 comments on commit 0e4dd3d

Please sign in to comment.