Skip to content

Commit 10e717e

Browse files
committed
Fix debug representation
1 parent 8c2b5a0 commit 10e717e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

packages/sync-rules/src/SqlBucketDescriptor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export class SqlBucketDescriptor implements BucketSource {
221221
let all_data_queries = [...this.dataQueries.values()].flat();
222222
return {
223223
name: this.name,
224-
type: this.type.toString(),
224+
type: BucketSourceType[this.type],
225225
bucket_parameters: this.bucketParameters,
226226
global_parameter_queries: this.globalParameterQueries.map((q) => {
227227
return {

packages/sync-rules/src/SqlSyncRules.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ export class SqlSyncRules implements SyncRules {
152152
return true;
153153
};
154154

155-
if (bucketMap == null) {
156-
rules.errors.push(new YamlError(new Error(`'bucket_definitions' is required`)));
155+
if (bucketMap == null && streamMap == null) {
156+
rules.errors.push(new YamlError(new Error(`'bucket_definitions' or 'streams' is required`)));
157157

158158
if (throwOnError) {
159159
rules.throwOnError();

packages/sync-rules/src/json_schema.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ export const syncRulesSchema: ajvModule.Schema = {
5656
patternProperties: {
5757
'.*': {
5858
type: 'object',
59-
required: ['data'],
60-
examples: [{ data: ['select * from mytable'] }],
59+
required: ['query'],
60+
examples: [{ query: ['select * from mytable'] }],
6161
properties: {
6262
accept_potentially_dangerous_queries: {
6363
description: 'If true, disables warnings on potentially dangerous queries',

packages/sync-rules/src/streams/stream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export class SyncStream implements BucketSource {
129129
debugRepresentation() {
130130
return {
131131
name: this.name,
132-
type: this.type.toString(),
132+
type: BucketSourceType[this.type],
133133
variants: this.variants.map((v) => v.debugRepresentation()),
134134
data: {
135135
table: this.data.sourceTable,

0 commit comments

Comments
 (0)