Skip to content

eon ​

@c9up/eon: the time-series layer on TDengine: super-table entities, columnar ingest, a windowed query builder, migrations, change-data subscriptions and test helpers, over a WebSocket connection to taosAdapter. Guide: Time series.

Installation ​

bash
pnpm add @c9up/eon

ream configure @c9up/eon registers the provider, writes config/timeseries.ts and adds TDENGINE_URL, TDENGINE_USER, TDENGINE_PASSWORD and TDENGINE_DATABASE to .env with their validation rules. @c9up/eon/testing/vitest needs vitest (an optional peer).

The native query compiler comes as one small package per platform, @c9up/eon-<platform>, for linux x64 and arm64 (glibc), macOS x64 and arm64, and Windows x64. @c9up/eon lists them as optional dependencies, and your package manager installs only the one that matches your machine. No Rust toolchain is needed. Do not install with optional dependencies turned off (--no-optional, --omit=optional): the compiler would be left out.

There is no JavaScript fallback. Without the compiler, the first statement eon compiles throws E_EON_NAPI_NOT_FOUND, and its message names the package to install, for example @c9up/eon-linux-x64-gnu.

Entry points ​

ImportContents
@c9up/eonDecorators, SuperTableRepository, TimeSeriesQuery, ingest helpers, schema and migrations, the connection, the consumer, EonProvider, types
@c9up/eon/providerEonProvider (default export)
@c9up/eon/services/connectionThe default connection (default export), setConnection, getConnection, clearConnection
@c9up/eon/schemaEonSchema, the builders, Migration, EonMigrationRunner, migrateChildTableNames, spec types, TYPE_KIND_MAP
@c9up/eon/tmqconnectWsConsumer, EonConsumer and its types, errors
@c9up/eon/healthEonConnectionCheck, EonHealthResult
@c9up/eon/testingFakeEonConnection, FakeEonConsumer, factory, test database helpers
@c9up/eon/testing/vitestdescribeIfTdengine
@c9up/eon/configureconfigure(codemods), run by ream configure

Exports ​

@c9up/eon ​

The root also re-exports everything of @c9up/eon/schema, @c9up/eon/tmq and @c9up/eon/health, documented below.

ExportKindDescription
SuperTablefunctionSuperTable(name: string): ClassDecorator: the class is a super-table.
TimestampfunctionTimestamp(options?: EonColumnOptions): PropertyDecorator: the timestamp column.
ColumnfunctionColumn(options?: EonColumnOptions): PropertyDecorator: a metric column.
TagfunctionTag(options?: EonTagOptions): PropertyDecorator: a tag; the tag values route a point to its child table.
getSuperTableMetadatafunctiongetSuperTableMetadata(target: object): SuperTableMetadata | undefined.
getTimestampColumnfunctiongetTimestampColumn(target: object): string | undefined.
getColumnMetadatafunctiongetColumnMetadata(target: object): EonColumnMetadata[].
getTagMetadatafunctiongetTagMetadata(target: object): EonTagMetadata[].
SuperTableRepositoryclassIngest and query one super-table.
TimeSeriesQueryclassWindowed query builder; awaiting it runs it.
TimeSeriesWhereclassThe WHERE part of a query, the type of a where(callback) group.
syncSuperTablefunctionsyncSuperTable(conn: EonConnection, EntityClass: SuperTableClass): Promise<void>: create the super-table of a class if missing.
dropSuperTablefunctiondropSuperTable(conn: EonConnection, EntityClass: SuperTableClass): Promise<void>.
createChildTablefunctioncreateChildTable(conn: EonConnection, options: CreateChildTableOptions): Promise<void>.
childTableNamefunctionchildTableName(stableOrEntity: string | SuperTableClass, tagValues: unknown[]): string: the deterministic child-table name of a tag set.
legacyChildTableNamefunctionSame signature: the name earlier versions derived, for migrateChildTableNames.
compileCreateStableSpecfunctioncompileCreateStableSpec(EntityClass: SuperTableClass): CreateStableSpec.
requireSuperTableNamefunctionrequireSuperTableName(EntityClass: SuperTableClass): string; throws E_EON_NOT_A_SUPERTABLE.
buildColumnarIngestfunctionbuildColumnarIngest(plan: ColumnarPlan, points: readonly IngestPoint[]): EonColumnarIngest.
compileStmtTemplatefunctioncompileStmtTemplate(stable: string, tagColumns: readonly string[], columns: readonly string[]): string.
groupByChildfunctiongroupByChild(stable: string, tagProperties: readonly string[], points: readonly IngestPoint[]): points grouped by child table.
toBindKindfunctiontoBindKind(logicalType: string | undefined, property: string): EonBindKind.
buildLiteralInsertsfunctionbuildLiteralInserts(plan: ColumnarPlan, points: readonly IngestPoint[]): string[]: one INSERT … USING … TAGS … VALUES per child table.
toLineProtocolfunctiontoLineProtocol(plan: ColumnarPlan, points: readonly IngestPoint[]): string[].
DEFAULT_BATCH_SIZEconst4096 rows per child per bind.
compileStatementNativefunctioncompileStatementNative(spec: object, dialect?: EonDialect): CompiledStatement: the Rust compiler.
quoteIdentNativefunctionquoteIdentNative(name: string): string.
connectWsEonfunctionconnectWsEon(config: EonConnectionConfig): Promise<EonConnection>: open a WebSocket connection, retrying the first connect as configured.
destroyEonConnectorfunctiondestroyEonConnector(): Promise<void>: kept as a no-op; each connection releases its own socket on close().
ensureDatabasefunctionensureDatabase(config: EonConnectionConfig, connect: EonConnector): Promise<void>: create config.database per createDatabase.
defineConfigfunctiondefineConfig(config: EonConfig): EonConfig.
EonProviderproviderSame class as @c9up/eon/provider.
errorsnamespaceThe package's errors, one class per code, see Errors. Each is a flare Exception with a string code.
EonConnectioninterface{ transport; exec(sql); query<T>(sql); ping(); ingestColumnar(request); schemaless(lines, options?); close() }.
EonConfiginterfaceEonConnectionConfig & { default?; connections?; migrationsDir? }.
EonConnectionConfiginterfaceOne connection's settings (see Configuration).
EonColumnOptionsinterface{ type?: string; length?: number; precision?: number; scale?: number; nullable?: boolean }.
EonTagOptionstypeEonColumnOptions without nullable.
EonColumnMetadata / EonTagMetadata / SuperTableMetadatainterfaceWhat the decorators record.
SuperTableClasstypeA constructor decorated with @SuperTable.
SuperTableRepositoryOptionsinterface{ batchSize?: number }.
IngestPointtypeRecord<string, unknown>.
ColumnarPlan / PlanColumninterfaceThe ingest plan of a super-table.
EonColumnarIngest / EonChildBatch / EonBoundColumn / EonBindKindinterface / typeThe columnar request a connection binds.
EonLineProtocoltype'influxdb' | 'opentsdb-telnet' | 'opentsdb-json'.
EonSchemalessPrecisiontype'hours' | 'minutes' | 'seconds' | 'milliseconds' | 'microseconds' | 'nanoseconds'.
EonSchemalessOptionsinterface{ protocol?: EonLineProtocol; precision?: EonSchemalessPrecision; ttl?: number }; defaults influxdb, milliseconds, 0.
CompiledStatementinterface{ statements: string[]; params: unknown[] }.
EonDialecttype'tdengine'.
EonScalartypestring | number | bigint | boolean | null.
EonWhereValuetypeEonScalar | readonly EonScalar[].
EonWhereOperatortype=, !=, <>, >, >=, <, <=, LIKE, NOT LIKE, IN, NOT IN, IS NULL, IS NOT NULL.
EonWhereCallbacktype(query: TimeSeriesWhere) => void.
EonFillModetype'none' | 'null' | 'prev' | 'next' | 'linear' | 'value'.
EonOrderDirectiontype'asc' | 'desc'.
EonSelectItemtypestring | EonFunctionSelect | EonPseudoSelect.
EonFunctionSelectinterface{ fn: string; column: string; as?: string }; fn is one of avg, sum, min, max, count, first, last, last_row, spread, twa.
EonPseudoSelectinterface{ pseudo: string; as?: string }; _wstart, _wend, _wduration or tbname.
CreateChildTableOptionsinterface{ stable?: string; EntityClass?: SuperTableClass; name: string; tags: unknown[]; ifNotExists?: boolean }.
EonAppContextinterfaceThe host the provider needs.
EonConnectortype(config: EonConnectionConfig) => Promise<EonConnection>.
EonServiceinterface{ compile(spec: object, dialect?: EonDialect): CompiledStatement }, bound as eon.compiler.
EonDatabaseOptionsinterface{ keep?; duration?; precision?: EonPrecision; buffer?; walLevel?: 1 | 2; cachemodel?: EonCacheModel }.
EonAlterDatabaseOptionsinterface{ keep?; buffer?; walLevel?; cachemodel?; replica?; minrows? }.
EonPrecisiontype'ms' | 'us' | 'ns'.
EonCacheModeltype'none' | 'last_row' | 'last_value' | 'both'.
EonLogicalTypetypeThe column types a decorator or builder accepts (timestamp, int, bigint, float, double, bool, varchar, nchar, binary, varbinary, json, decimal…).
EonColumnSpecinterface{ name; kind; length; precision; scale }.
CreateStableSpec / AlterStableSpec / DropStableSpec / CreateChildTableSpec / CreateDatabaseSpec / AlterDatabaseSpec / CreateTableSpec / DropTableSpec / AlterChangeinterface / typeThe statement specs the compiler takes.
AlterTypeSetter / StableColumnHandleinterfaceReturned by the alter and create builders.

@c9up/eon/provider ​

ExportKindDescription
default (EonProvider)providernew EonProvider(app: EonAppContext, connect?: EonConnector). register() binds the tokens; boot() reads config/timeseries.ts (or the eon key), creates the database when asked, opens every connection, seats the default one on services/connection and registers eon's migration runner with ream's migrations registry; nothing is opened when the app runs in inspection mode. shutdown() closes every connection.

@c9up/eon/services/connection ​

ExportKindDescription
defaultconstThe default EonConnection; a member read before boot throws.
setConnectionfunctionsetConnection(connection: EonConnection): void.
getConnectionfunctiongetConnection(): EonConnection | undefined.
clearConnectionfunctionclearConnection(connection: EonConnection): void: clears it if it is this one.

@c9up/eon/schema ​

ExportKindDescription
EonSchemaclassCollects DDL: createStable, alterStable, dropStable, createDatabase, alterDatabase, createTable, dropTable, raw, then toSQL().
StableBuilderclassColumns and tags of a super-table.
BasicTableBuilderclassColumns of a plain table.
AlterStableBuilderclassaddColumn, modifyColumn, dropColumn, addTag, modifyTag, dropTag, renameTag.
MigrationclassAbstract base of a migration: up(), down(), this.schema, raw(sql).
EonMigrationRunnerclassRuns the migrations of a directory against one connection.
migrateChildTableNamesfunctionmigrateChildTableNames(conn: EonConnection, EntityClass: SuperTableClass, options?: MigrateChildTableNamesOptions): Promise<ChildTableMigrationReport>: rename child tables named the earlier way.
TYPE_KIND_MAPconstLogical type name to compiler kind.
EonMigrationOptionsinterface{ migrationsDir?: string; tableName?: string; disableLocks?: boolean }.
MigrationStatetype'applied' | 'pending'.
MigrationStatusinterface{ name: string; status: MigrationState; batch?: number }.
ChildTableRenameinterface{ from: string; to: string; tags: readonly unknown[] }.
ChildTableMigrationReportinterface{ renamed: readonly ChildTableRename[]; current: readonly string[]; unmatched: readonly string[] }.
MigrateChildTableNamesOptionsinterface{ dryRun?: boolean }.
CreateStableSpec / CreateTableSpecinterfaceSpecs, as on the root.

@c9up/eon/tmq ​

ExportKindDescription
connectWsConsumerfunctionconnectWsConsumer(config: EonConsumerConfig): Promise<EonConsumer>: a subscription consumer over WebSocket.
EonConsumerinterfacesubscribe(topics), subscription(), poll<T>(timeoutMs): Promise<EonMessage<T>[]>, commit(), assignment(topics?), seek(partition), unsubscribe(), close().
EonConsumerConfiginterface{ url; groupId; clientId?; user?; password?; token?; offsetReset?: EonOffsetReset; autoCommit?; autoCommitIntervalMs?; withTableName? }.
EonMessageinterface{ topic: string; rows: T[] }.
EonTopicPartitioninterface{ topic: string; vgroupId: number; offset?: bigint; begin?: bigint; end?: bigint }.
EonOffsetResettype'earliest' | 'latest' | 'none'.
errorsnamespaceThe same errors namespace as @c9up/eon.

@c9up/eon/health ​

ExportKindDescription
EonConnectionCheckclassnew EonConnectionCheck(conn: EonConnection), named TDengine connection check: as(name), cacheFor(seconds), warnWhenSlowerThan(milliseconds), run(): Promise<EonHealthResult>.
EonHealthResultinterface{ message; status: 'ok' | 'warning' | 'error'; finishedAt: Date; meta? }.

@c9up/eon/testing ​

ExportKindDescription
FakeEonConnectionclassAn in-memory EonConnection: records statements, stores ingested rows (rows(table)), answers flat SELECTs; reset(). new FakeEonConnection(options?: { precision?: EonPrecision }).
FakeEonConsumerclassAn in-memory EonConsumer: push(...messages), committedCount, isClosed.
factoryfunctionfactory<T>(EntityClass, defaults: () => Record<string, unknown>): FactoryBuilder<T>.
FactoryBuilderinterfacemerge, state, apply, make, makeMany, makeStubbed, create(conn), createMany(count, conn).
hasTestServerfunctionhasTestServer(): boolean: EON_TEST_URL is set.
connectTestEonfunctionconnectTestEon(overrides?: Partial<EonConnectionConfig>): Promise<EonConnection>: connect to EON_TEST_URL.
resetDatabasefunctionresetDatabase(conn: EonConnection, db: string): Promise<void>: drop and recreate a database.
createTestDatabasefunctioncreateTestDatabase(conn, database, options?: { keepMs?: number }): Promise<void>.
dropTestDatabasefunctiondropTestDatabase(conn, database): Promise<void>.
dropTestTopicfunctiondropTestTopic(conn, topic, options?: { retries?: number; delayMs?: number }): Promise<void>.
withTestDatabasefunctionwithTestDatabase<T>(conn, database, body: () => Promise<T>): Promise<T>: create, run, drop.
FakeEonConnectionOptionsinterface{ precision?: EonPrecision }, ms by default.

@c9up/eon/testing/vitest ​

ExportKindDescription
describeIfTdenginefunctiondescribeIfTdengine(name: string, factory: () => void): void: a suite that runs only when EON_TEST_URL is set.

SuperTableRepository ​

new SuperTableRepository(entityClass: SuperTableClass, conn: EonConnection, options?: SuperTableRepositoryOptions).

MemberSignatureDescription
queryquery(): TimeSeriesQuery<Record<string, unknown>> or query<E>(mapPoint: (row) => E): TimeSeriesQuery<E>A query on the super-table.
ingestingest(point: IngestPoint): Promise<void>One point.
ingestManyingestMany(points: readonly IngestPoint[]): Promise<{ rowsAffected: number }>Columnar STMT ingest, grouped by child table: the default bulk path.
ingestSqlingestSql(points: readonly IngestPoint[]): Promise<{ rowsAffected: number }>Literal INSERT statements.
ingestSchemalessingestSchemaless(points: readonly IngestPoint[], options?: EonSchemalessOptions): Promise<void>Line protocol; slower than ingestMany.

TimeSeriesQuery ​

MemberSignatureDescription
where / andWhere / orWherewhere(column: string, operator: EonWhereOperator, value: EonWhereValue): thisAlso (column, value) and (callback) for a group.
whereNull / whereNotNullwhereNull(column: string): this
whereBetweenwhereBetween(column: string, range: readonly [EonScalar, EonScalar]): this
selectselect(items: readonly EonSelectItem[]): thisColumns, allowed functions, pseudo-columns.
intervalinterval(value: string, offset?: string): thisWindow size ('1m', '1h').
slidingsliding(value: string): thisNeeds interval.
fillfill(mode: EonFillMode, ...values: readonly EonScalar[]): thisNeeds interval.
partitionBypartitionBy(...columns: readonly string[]): this
orderByorderBy(column: string, direction?: EonOrderDirection): thisasc by default.
limit / offsetlimit(n: number): thisoffset needs limit.
toSQLtoSQL(): { sql: string; params: unknown[] }
exec / allexec(): Promise<TPoint[]>Also run by await.
firstfirst(): Promise<TPoint | null>

EonMigrationRunner ​

new EonMigrationRunner(conn: EonConnection, options?: EonMigrationOptions); directory database/eon-migrations and table ream_eon_migrations by default.

MemberSignatureDescription
initinit(): Promise<void>Create the tracking table.
statusstatus(): Promise<MigrationStatus[]>
migratemigrate(): Promise<string[]>Run pending migrations.
rollbackrollback(): Promise<string[]>Roll back the last batch.
resetreset(): Promise<string[]>Roll back everything.
refresh / freshrefresh(): Promise<{ rolled: string[]; executed: string[] }>Reset, then migrate.
dryRundryRun(): Promise<Array<{ name: string; sql: string[] }>>The SQL pending migrations would run.
forceUnlockforceUnlock(): Promise<boolean>Clear a stale migration lock.

Configuration ​

config/timeseries.ts, read under the timeseries key (eon is read when it is absent).

OptionTypeDefaultDescription
urlstring—taosAdapter WebSocket URL, ws://localhost:6041.
user / passwordstring—Credentials.
tokenstring—Bearer token, instead of user and password.
databasestring—Database to USE on connect.
createDatabaseboolean | EonDatabaseOptionsunsetCreate database before the first connection selects it. The generated config passes { precision: 'ms' }.
timeoutMsnumber60000Per-request timeout, also the connect deadline.
connectRetriesnumber0Extra attempts of the first connection.
connectBackoffMsnumber200Base of the exponential backoff between them, capped at 30 s.
defaultstring'primary'Default connection when connections is set.
connectionsRecord<string, EonConnectionConfig>—Named connections.
migrationsDirstring'database/eon-migrations'eon's migrations, apart from atlas's.

Container bindings ​

TokenResolves to
'eon'The default EonConnection, once boot() opened it
'eon.connection'The same connection
'eon:<name>'A named connection
'eon.compiler'EonService

eon, eon.connection and eon.compiler are typed on ContainerBindings once @c9up/eon is imported.

Errors ​

Every code is on error.code, and each code is a class of the errors namespace: error instanceof errors.E_EON_NO_TIMESTAMP, with import { errors } from '@c9up/eon'. Each is a flare Exception. A refusal from the TDengine server is E_EON_SERVER_ERROR, with TDengine's numeric code on taosCode. The query compiler's refusals arrive with the same codes: eon reads the compiler's message back into the matching error and keeps the compiler's own error as cause.

CodeRaised when
E_EON_MISSING_CONNECTIONA repository has no connection to run on.
E_EON_NOT_A_SUPERTABLEA class used as a super-table is not decorated with @SuperTable.
E_EON_NO_TAGSA super-table has no @Tag column, so a child table cannot be routed.
E_EON_NO_TIMESTAMPA super-table has no @Timestamp column.
E_EON_CHILD_STABLEcreateChildTable() was given neither stable nor EntityClass.
E_EON_CHILD_COLLISIONTwo distinct tag sets map to the same child table; eon refuses to write mismatched rows under one tag set.
E_EON_CHILD_MIGRATIONmigrateChildTableNames() read a child listing row without a table name.
E_EON_BATCH_SIZEbatchSize is not a positive integer.
E_EON_BINDA value cannot be written to its STMT placeholder as given: the wrong type, or a decimal the column cannot hold exactly.
E_EON_SERVER_VERSIONThe columnar STMT path needs TDengine 3.3.6.0 or later (stmt2).
E_EON_TYPEA column or tag has an unknown or missing type.
E_EON_TS_TYPEA timestamp is neither a bigint nor a safe-integer number.
E_EON_PARAM_PRECISIONA timestamp number is not a safe integer; pass nanosecond timestamps as bigint.
E_EON_VALUE_TYPEAn integer column was given something other than a safe integer or a bigint.
E_EON_VALUE_RANGEA value is outside its column type's range; the connector would truncate it silently.
E_EON_TEMPLATEThe compiler returned no statement for the STMT insert template.
E_EON_LITERAL_INSERTA literal insert for one child table compiled to other than exactly one statement.
E_EON_HYDRATE_BIGINTA bigint or timestamp column came back with a non-integer value.
E_EON_DECODEA server reply or result block does not match the protocol (truncated, unknown type, rows without column metadata); a frame that cannot be trusted closes the connection.
E_EON_TIMEOUTA request to TDengine got no reply within timeoutMs.
E_EON_CLOSEDThe TDengine connection closed while a request was waiting, or a request was sent on a closed one.
E_EON_CONNECTThe WebSocket to taosAdapter could not be opened: a bad URL, a refused connection, or no handshake within the deadline. A URL that does not parse is not attached as the cause.
E_EON_SERVER_ERRORThe TDengine server refused a request (a bad statement, a missing table, bad credentials); taosCode holds TDengine's numeric error code.
E_EON_NO_TOPICsubscribe() was given no topic; the server would accept it and deliver nothing.
E_EON_SEEK_NO_OFFSETseek() was given a partition without an offset.
E_EON_SCHEMALESS_SCHEMAA field type has no line-protocol form.
E_EON_SCHEMALESS_FIELDA line-protocol field value is outside its type's range.
E_EON_SCHEMALESS_TAGA line-protocol tag value cannot be written.
E_EON_SCHEMALESS_EMPTY_TAGA line-protocol tag value is empty.
E_EON_SCHEMALESS_NO_FIELDSA line-protocol point has no field.
E_EON_SCHEMALESS_MEASUREMENTThe super-table (measurement) name is empty.
E_EON_SCHEMALESS_CONTROL_CHARA line-protocol name or value holds a line terminator or control character; it is refused, not escaped.
E_EON_INVALID_VALUEwhere() with one argument takes a callback that fills a group.
E_EON_EMPTY_WHERE_GROUPA where(callback) group added no predicate.
E_EON_INVALID_LIMITlimit() was given a value that is not a non-negative integer.
E_EON_INVALID_OFFSEToffset() was given a value that is not a non-negative integer.
E_EON_COMPILE_EMPTYThe compiler returned no SQL statement.
E_EON_UNEXPECTED_PARAMSA time-series query compiled with bound parameters where literal SQL is expected.
E_EON_INTERNALAn invariant inside eon broke, or the Rust compiler panicked or could not serialize what it compiled: always a bug in eon itself.
E_EON_ALTER_DB_ONE_OPTIONalterDatabase() takes exactly one option.
E_EON_MIGRATION_INVALIDThe migrations tracking table holds an unreadable executed_at.
E_EON_MIGRATION_LOCKEDAnother run holds the migration lock.
E_EON_FACTORY_STATEA factory state is not defined.
E_EON_FAKE_UNSUPPORTEDFakeEonConnection answers only flat SELECTs; windowed or aggregate SQL needs a live TDengine.
E_EON_TEST_IDENTIFIERA test cleanup helper was given a name that is not a plain identifier.
E_EON_NOT_BOOTEDAn eon connection (the eon token, eon:<name>, or @c9up/eon/services/connection) was used before EonProvider.boot() opened it.
E_EON_ALREADY_BOOTEDEonProvider.boot() ran a second time while its connections are open; call shutdown() first.
E_EON_BOOT_FAILEDEonProvider.boot() could not open one or more configured connections; cause holds the first failure.
E_EON_UNKNOWN_CONNECTIONThe default connection named in config/timeseries.ts is not among its connections.
E_EON_NO_DATABASEcreateDatabase is set but no database is configured.
E_EON_TEST_URLconnectTestEon() was called without EON_TEST_URL.
E_EON_NAPI_NOT_FOUNDThe eon query compiler binary is not found.
E_EON_NAPI_UNSUPPORTEDThere is no eon query compiler binary for this platform.
E_EON_INVALID_DURATIONA duration is not a positive integer followed by one unit.
E_EON_INVALID_FILLA FILL mode is not one TDengine knows, or lacks its value.
E_EON_FILL_REQUIRES_INTERVALFILL was used without INTERVAL.
E_EON_SLIDING_REQUIRES_INTERVALSLIDING was used without INTERVAL.
E_EON_OFFSET_REQUIRES_LIMITOFFSET was used without LIMIT.
E_EON_INVALID_ORDER_DIRECTIONAn order direction is neither asc nor desc.
E_EON_INVALID_PSEUDO_COLUMNA pseudo-column is not one eon allows.
E_EON_INVALID_SELECTA select expression cannot be compiled.
E_EON_INVALID_SELECT_FUNCTIONA select names a function eon does not allow.
E_EON_INVALID_DB_OPTIONA database option value is invalid.
E_EON_UNKNOWN_DB_OPTIONA database option is not alterable (KEEP, BUFFER, WAL_LEVEL, CACHEMODEL, REPLICA, MINROWS).
E_EON_IMMUTABLE_DB_OPTIONA database option is fixed at CREATE and cannot be altered.
E_EON_INVALID_TTLA child-table TTL is not a non-negative whole number of days.
E_EON_INVALID_WAL_LEVELA WAL_LEVEL is not one TDengine accepts.
E_EON_INVALID_CACHEMODELA CACHEMODEL is not one TDengine accepts.
E_EON_INVALID_PRECISIONA database precision is not ms, us or ns.
E_EON_KEEP_TOO_SMALLKEEP is less than three times DURATION.
E_TS_REQUIREDA super-table's first column is not a TIMESTAMP.
E_TAGS_REQUIREDA super-table declares no tag, or an INSERT that auto-creates a child table (using), or its STMT template, has no tag.
E_JSON_TAG_RULEJSON is tag-only and must be the only tag.
E_TYPE_NOT_TAGGABLEA type that cannot be a tag (DECIMAL) is used as one.
E_LENGTH_REQUIREDA type that needs a length (BINARY(n), NCHAR(n)…) was given none.
E_NAME_COLLISIONA name is listed more than once across the STMT template's tag and value columns.
E_INVALID_CLAUSE_TYPEA WHERE connector is neither and nor or.
E_INVALID_WHERE_GROUPA WHERE group is empty, or also names a column.
E_INVALID_WHERE_VALUEA WHERE value (or list element) is not a scalar, or an IN value is not a list.
E_UNSAFE_IDENTIFIERThe compiler refused an identifier.
E_UNSAFE_LITERALThe compiler refused a literal value.
E_UNSAFE_OPERATORThe compiler refused an operator.
E_EON_INVALID_INSERTAn INSERT reached the compiler with no column, no row, a row whose width differs from the column list, or tags without using.
E_EON_ALTER_EMPTYAn ALTER STABLE reached the compiler with no change.
E_UNSUPPORTED_CLIENTThe compiler was asked for a dialect other than tdengine.
E_EON_INVALID_SPECThe statement the compiler received does not parse. Eon builds every spec itself, so this points at an eon bug or at a spec built by hand.

Migration ​

  • EonError, EonConnectionError and EonConsumerError are gone: each code is its own class of the errors namespace. Replace instanceof EonError with a test on error.code, or with instanceof errors.E_EON_..., errors coming from @c9up/eon (or @c9up/eon/tmq).
  • A refusal from the TDengine server is errors.E_EON_SERVER_ERROR: its code is the string 'E_EON_SERVER_ERROR', and TDengine's numeric code moved to taosCode. error.code === 9731 becomes error instanceof errors.E_EON_SERVER_ERROR && error.taosCode === 9731.
  • A client-side failure carries its code on error.code (E_EON_TIMEOUT, E_EON_CLOSED, E_EON_DECODE, E_EON_CONNECT, E_EON_BIND, E_EON_SERVER_VERSION), no longer as a [E_EON_…] tag at the start of the message.
  • A query compiler refusal carries its code on error.code (E_UNSAFE_IDENTIFIER, E_EON_INVALID_FILL…), no longer as CODE: at the start of the message.
  • E_EON_CONNECT for a URL that does not parse no longer carries Node's TypeError as its cause: that error held the whole URL, password included. Read the message instead.

See also ​