Skip to content

Commit

Permalink
Merge branch 'main' into topic
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Zorkaltsev authored Aug 14, 2024
2 parents ff4e90e + aa5799d commit de6ee86
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions examples/basic-example-v2-with-query-service/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Driver, getCredentialsFromEnv, Logger, RowType} from 'ydb-sdk';
import {Episode, getEpisodesData, getSeasonsData, getSeriesData, Series} from './data-helpers';
import {main} from '../utils';
import {SchemeError} from "../../src/errors";

process.env.YDB_SDK_PRETTY_LOGS = '1';

Expand All @@ -12,12 +13,20 @@ async function createTables(driver: Driver, logger: Logger) {
logger.info('Dropping old tables and create new ones...');
await driver.queryClient.do({
fn: async (session) => {

try {
await session.execute({
text: `
DROP TABLE ${SERIES_TABLE};
DROP TABLE ${EPISODES_TABLE};
DROP TABLE ${SEASONS_TABLE};`,
});
} catch (err) { // Ignore if tables are missing
if (err instanceof SchemeError) throw err;
}

await session.execute({
text: `
DROP TABLE IF EXISTS ${SERIES_TABLE};
DROP TABLE IF EXISTS ${EPISODES_TABLE};
DROP TABLE IF EXISTS ${SEASONS_TABLE};
CREATE TABLE ${SERIES_TABLE}
(
series_id UInt64,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {initDriver, destroyDriver} from "../../../utils/test";

const SHUTDOWN_URL = process.env.YDB_SHUTDOWN_URL || 'http://localhost:8765/actors/kqp_proxy?force_shutdown=all';

xdescribe('Graceful session close', () => {
describe('Graceful session close', () => {

// TODO: Fix and enable test nce issue will be resolved https://github.com/ydb-platform/ydb/issues/2981
// TODO: Make the same test for query service
Expand Down

0 comments on commit de6ee86

Please sign in to comment.