Skip to content

Commit c2245b2

Browse files
authored
Merge pull request #487 from atelier-saulx/feature/remove-pg
Remove timeseries
2 parents 845130f + 8a61b8c commit c2245b2

File tree

8 files changed

+25
-1041
lines changed

8 files changed

+25
-1041
lines changed

client/package.json

-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@
6969
},
7070
"dependencies": {
7171
"@saulx/validators": "^1.1.0",
72-
"pg": "8.7.1",
73-
"pg-native": "3.0.0",
7472
"squel": "^5.13.0",
7573
"data-record": "^1.0.0",
7674
"@saulx/selva-query-ast-parser": "^4.0.2",

client/src/get/executeGetOperations/index.ts

+6-13
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { GetOptions } from '../'
1010
import find from './find'
1111
import aggregate from './aggregate'
1212
import inherit from './inherit'
13-
import timeseries from './timeseries'
13+
// import timeseries from './timeseries'
1414
import { Rpn, bfsExpr2rpn } from '@saulx/selva-query-ast-parser'
1515
import { FieldSchemaArrayLike, Schema } from '~selva/schema'
1616
import { ServerDescriptor } from '~selva/types'
@@ -548,11 +548,7 @@ export function typeCast(
548548
}
549549

550550
if (fs.timeseries) {
551-
const vIdx = x.findIndex((el) => {
552-
return el === '_value'
553-
})
554-
555-
x = x[vIdx + 1]
551+
console.warn('Timeseries not is discontinued in this version.')
556552
}
557553

558554
const cast = TYPE_CASTS[fs.type]
@@ -895,17 +891,14 @@ export const executeGetOperation = async (
895891
)
896892
} else if (op.type === 'find') {
897893
if (op.isTimeseries) {
898-
return timeseries(client, op, lang, ctx)
899-
} else {
900-
return find(client, op, lang, ctx, schema)
894+
console.warn('Timeseries not is discontinued in this version.')
901895
}
896+
return find(client, op, lang, ctx, schema)
902897
} else if (op.type === 'aggregate') {
903898
if (op.isTimeseries) {
904-
// add this later...
905-
return timeseries(client, op, lang, ctx)
906-
} else {
907-
return aggregate(client, op, lang, ctx, schema)
899+
console.warn('Timeseries not is discontinued in this version.')
908900
}
901+
return aggregate(client, op, lang, ctx, schema)
909902
} else if (op.type === 'inherit') {
910903
return inherit(client, op, lang, ctx, schema)
911904
} else if (op.type === 'raw') {

client/src/get/executeGetOperations/timeseries.ts

-185
This file was deleted.

client/src/index.ts

-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import { updateSchema } from './schema/updateSchema'
2323
import { getSchema } from './schema/getSchema'
2424
import conformToSchema from './schema/conformToSchema'
2525
import initializeSchema from './schema/initializeSchema'
26-
import { TimeseriesClient } from './timeseries'
2726
import { GetOptions, ObserveEventOptions, GetResult, get } from './get'
2827
import { SetOptions, set, setWithMeta } from './set'
2928
import { IdOptions } from 'lua/src/id'
@@ -49,7 +48,6 @@ let clientId = 0
4948

5049
export class SelvaClient extends EventEmitter {
5150
public redis: Redis
52-
public pg: TimeseriesClient
5351

5452
public selvaId: string
5553

@@ -143,7 +141,6 @@ export class SelvaClient extends EventEmitter {
143141
this.selvaId = ++clientId + ''
144142
this.redis = new Redis(this)
145143
connectRegistry(this, opts)
146-
this.pg = new TimeseriesClient(this)
147144
}
148145

149146
connect(opts: ConnectOptions) {

0 commit comments

Comments
 (0)