velocious 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/{velocious.mjs → velocious.js} +1 -1
- package/package.json +3 -3
- package/peak_flow.yml +1 -1
- package/spec/cli/commands/db/{create-spec.mjs → create-spec.js} +2 -2
- package/spec/cli/commands/db/{migrate-spec.mjs → migrate-spec.js} +2 -2
- package/spec/cli/commands/destroy/{migration-spec.mjs → migration-spec.js} +2 -2
- package/spec/cli/commands/generate/{migration-spec.mjs → migration-spec.js} +3 -3
- package/spec/cli/commands/{init-spec.mjs → init-spec.js} +6 -6
- package/spec/cli/commands/test/{test-files-finder-spec.mjs → test-files-finder-spec.js} +2 -2
- package/spec/database/connection/drivers/mysql/{query-parser-spec.mjs → query-parser-spec.js} +6 -6
- package/spec/database/drivers/mysql/{connection-spec.mjs → connection-spec.js} +2 -2
- package/spec/database/record/{create-spec.mjs → create-spec.js} +2 -2
- package/spec/database/record/{destroy-spec.mjs → destroy-spec.js} +2 -2
- package/spec/database/record/{find-spec.mjs → find-spec.js} +2 -2
- package/spec/database/record/{query-spec.mjs → query-spec.js} +2 -2
- package/spec/database/record/{update-spec.mjs → update-spec.js} +2 -2
- package/spec/dummy/{index.mjs → index.js} +2 -2
- package/spec/dummy/src/config/{configuration.example.mjs → configuration.example.js} +6 -6
- package/spec/dummy/src/config/{configuration.peakflow.mjs → configuration.peakflow.js} +6 -6
- package/spec/dummy/src/config/{routes.mjs → routes.js} +1 -1
- package/spec/dummy/src/database/migrations/{20230728075328-create-projects.mjs → 20230728075328-create-projects.js} +1 -1
- package/spec/dummy/src/database/migrations/{20230728075329-create-tasks.mjs → 20230728075329-create-tasks.js} +1 -1
- package/spec/dummy/src/database/migrations/{20250605133926-create-project-translations.mjs → 20250605133926-create-project-translations.js} +1 -1
- package/spec/dummy/src/models/{project.mjs → project.js} +1 -1
- package/spec/dummy/src/models/{task.mjs → task.js} +1 -1
- package/spec/dummy/src/routes/tasks/{controller.mjs → controller.js} +2 -2
- package/spec/http-server/{client-spec.mjs → client-spec.js} +3 -3
- package/spec/http-server/{get-spec.mjs → get-spec.js} +1 -1
- package/spec/http-server/{post-spec.mjs → post-spec.js} +2 -2
- package/spec/support/jasmine.json +2 -2
- package/src/{application.mjs → application.js} +3 -3
- package/src/cli/commands/db/{create.mjs → create.js} +2 -2
- package/src/cli/commands/db/{migrate.mjs → migrate.js} +3 -3
- package/src/cli/commands/destroy/{migration.mjs → migration.js} +2 -2
- package/src/cli/commands/generate/{migration.mjs → migration.js} +4 -4
- package/src/cli/commands/generate/{model.mjs → model.js} +4 -4
- package/src/cli/commands/{init.mjs → init.js} +6 -6
- package/src/cli/commands/{server.mjs → server.js} +1 -1
- package/src/cli/commands/test/{index.mjs → index.js} +3 -3
- package/src/cli/commands/test/{test-files-finder.mjs → test-files-finder.js} +1 -1
- package/src/cli/{index.mjs → index.js} +4 -4
- package/src/{configuration-resolver.mjs → configuration-resolver.js} +5 -3
- package/src/{configuration.mjs → configuration.js} +1 -1
- package/src/database/drivers/{base.mjs → base.js} +2 -2
- package/src/database/drivers/mysql/{index.mjs → index.js} +11 -11
- package/src/database/drivers/mysql/{options.mjs → options.js} +1 -1
- package/src/database/drivers/mysql/{query-parser.mjs → query-parser.js} +1 -1
- package/src/database/drivers/mysql/sql/{create-database.mjs → create-database.js} +1 -1
- package/src/database/drivers/{sqlite/sql/create-table.mjs → mysql/sql/create-table.js} +1 -1
- package/src/database/drivers/mysql/sql/{delete.mjs → delete.js} +1 -1
- package/src/database/drivers/mysql/sql/{insert.mjs → insert.js} +1 -1
- package/src/database/drivers/mysql/sql/{update.mjs → update.js} +1 -1
- package/src/database/drivers/mysql/{table.mjs → table.js} +1 -1
- package/src/database/drivers/sqlite/{base.mjs → base.js} +16 -8
- package/src/database/drivers/sqlite/{index.web.mjs → index.web.js} +1 -1
- package/src/database/drivers/sqlite/{options.mjs → options.js} +1 -1
- package/src/database/drivers/sqlite/{query-parser.mjs → query-parser.js} +1 -1
- package/src/database/drivers/sqlite/sql/alter-table.js +4 -0
- package/src/database/drivers/sqlite/sql/{create-index.mjs → create-index.js} +1 -1
- package/src/database/drivers/{mysql/sql/create-table.mjs → sqlite/sql/create-table.js} +1 -1
- package/src/database/drivers/sqlite/sql/{delete.mjs → delete.js} +1 -1
- package/src/database/drivers/sqlite/sql/{insert.mjs → insert.js} +1 -1
- package/src/database/drivers/sqlite/sql/{update.mjs → update.js} +1 -1
- package/src/database/drivers/sqlite/{table.mjs → table.js} +1 -1
- package/src/database/{migrate-from-require-context.mjs → migrate-from-require-context.js} +3 -3
- package/src/database/migration/{index.mjs → index.js} +13 -1
- package/src/database/pool/{async-tracked-multi-connection.mjs → async-tracked-multi-connection.js} +1 -1
- package/src/database/pool/{base.mjs → base.js} +3 -1
- package/src/database/pool/{single-multi-use.mjs → single-multi-use.js} +1 -1
- package/src/database/query/alter-table-base.js +26 -0
- package/src/database/query/{create-database-base.mjs → create-database-base.js} +1 -1
- package/src/database/query/{create-index-base.mjs → create-index-base.js} +1 -1
- package/src/database/query/{create-table-base.mjs → create-table-base.js} +2 -2
- package/src/database/query/{delete-base.mjs → delete-base.js} +1 -1
- package/src/database/query/{from-plain.mjs → from-plain.js} +1 -1
- package/src/database/query/{from-table.mjs → from-table.js} +1 -1
- package/src/database/query/{index.mjs → index.js} +7 -7
- package/src/database/query/{join-plain.mjs → join-plain.js} +1 -1
- package/src/database/query/{order-plain.mjs → order-plain.js} +1 -1
- package/src/database/query/preloader/{belongs-to.mjs → belongs-to.js} +1 -1
- package/src/database/query/preloader/{has-many.mjs → has-many.js} +1 -1
- package/src/database/query/{preloader.mjs → preloader.js} +3 -3
- package/src/database/query/{select-plain.mjs → select-plain.js} +1 -1
- package/src/database/query/{select-table-and-column.mjs → select-table-and-column.js} +1 -1
- package/src/database/query/{where-hash.mjs → where-hash.js} +1 -1
- package/src/database/query/{where-plain.mjs → where-plain.js} +1 -1
- package/src/database/query-parser/{base-query-parser.mjs → base-query-parser.js} +7 -7
- package/src/database/query-parser/{joins-parser.mjs → joins-parser.js} +1 -1
- package/src/database/record/{index.mjs → index.js} +9 -9
- package/src/database/record/instance-relationships/{belongs-to.mjs → belongs-to.js} +1 -1
- package/src/database/record/instance-relationships/{has-many.mjs → has-many.js} +1 -1
- package/src/database/record/relationships/{belongs-to.mjs → belongs-to.js} +1 -1
- package/src/database/record/relationships/{has-many.mjs → has-many.js} +1 -1
- package/src/database/table-data/{index.mjs → index.js} +4 -0
- package/src/http-server/client/{index.mjs → index.js} +3 -3
- package/src/http-server/client/request-buffer/{index.mjs → index.js} +4 -4
- package/src/http-server/client/{request-parser.mjs → request-parser.js} +2 -2
- package/src/http-server/client/{request-runner.mjs → request-runner.js} +3 -3
- package/src/http-server/client/{request.mjs → request.js} +1 -1
- package/src/http-server/{index.mjs → index.js} +3 -3
- package/src/http-server/{server-client.mjs → server-client.js} +1 -1
- package/src/http-server/worker-handler/{index.mjs → index.js} +2 -2
- package/src/http-server/worker-handler/{worker-script.mjs → worker-script.js} +1 -1
- package/src/http-server/worker-handler/{worker-thread.mjs → worker-thread.js} +5 -5
- package/src/routes/{app-routes.mjs → app-routes.js} +1 -1
- package/src/routes/{base-route.mjs → base-route.js} +2 -2
- package/src/routes/{get-route.mjs → get-route.js} +1 -1
- package/src/routes/{index.mjs → index.js} +1 -1
- package/src/routes/{resolver.mjs → resolver.js} +1 -1
- package/src/routes/{resource-route.mjs → resource-route.js} +1 -1
- package/src/routes/{root-route.mjs → root-route.js} +1 -1
- package/src/templates/{configuration.mjs → configuration.js} +3 -3
- package/src/templates/{generate-migration.mjs → generate-migration.js} +1 -1
- package/src/templates/{generate-model.mjs → generate-model.js} +1 -1
- package/src/templates/{routes.mjs → routes.js} +1 -1
- /package/{index.mjs → index.js} +0 -0
- /package/spec/dummy/{dummy-directory.mjs → dummy-directory.js} +0 -0
- /package/src/{big-brother.mjs → big-brother.js} +0 -0
- /package/src/cli/{base-command.mjs → base-command.js} +0 -0
- /package/src/cli/commands/test/{test-runner.mjs → test-runner.js} +0 -0
- /package/src/{controller.mjs → controller.js} +0 -0
- /package/src/database/drivers/mysql/{column.mjs → column.js} +0 -0
- /package/src/database/drivers/mysql/{connect-connection.mjs → connect-connection.js} +0 -0
- /package/src/database/drivers/mysql/{query.mjs → query.js} +0 -0
- /package/src/database/drivers/sqlite/{column.mjs → column.js} +0 -0
- /package/src/database/drivers/sqlite/{index.native.mjs → index.native.js} +0 -0
- /package/src/database/drivers/sqlite/{query.native.mjs → query.native.js} +0 -0
- /package/src/database/drivers/sqlite/{query.web.mjs → query.web.js} +0 -0
- /package/src/database/{handler.mjs → handler.js} +0 -0
- /package/src/database/{initializer-from-require-context.mjs → initializer-from-require-context.js} +0 -0
- /package/src/database/{migrator.mjs → migrator.js} +0 -0
- /package/src/database/query/{base.mjs → base.js} +0 -0
- /package/src/database/query/{from-base.mjs → from-base.js} +0 -0
- /package/src/database/query/{insert-base.mjs → insert-base.js} +0 -0
- /package/src/database/query/{join-base.mjs → join-base.js} +0 -0
- /package/src/database/query/{order-base.mjs → order-base.js} +0 -0
- /package/src/database/query/{select-base.mjs → select-base.js} +0 -0
- /package/src/database/query/{update-base.mjs → update-base.js} +0 -0
- /package/src/database/query/{where-base.mjs → where-base.js} +0 -0
- /package/src/database/query-parser/{from-parser.mjs → from-parser.js} +0 -0
- /package/src/database/query-parser/{group-parser.mjs → group-parser.js} +0 -0
- /package/src/database/query-parser/{limit-parser.mjs → limit-parser.js} +0 -0
- /package/src/database/query-parser/{options.mjs → options.js} +0 -0
- /package/src/database/query-parser/{order-parser.mjs → order-parser.js} +0 -0
- /package/src/database/query-parser/{select-parser.mjs → select-parser.js} +0 -0
- /package/src/database/query-parser/{where-parser.mjs → where-parser.js} +0 -0
- /package/src/database/record/instance-relationships/{base.mjs → base.js} +0 -0
- /package/src/database/record/{record-not-found-error.mjs → record-not-found-error.js} +0 -0
- /package/src/database/record/relationships/{base.mjs → base.js} +0 -0
- /package/src/{error-logger.mjs → error-logger.js} +0 -0
- /package/src/http-server/client/{params-to-object.mjs → params-to-object.js} +0 -0
- /package/src/http-server/client/request-buffer/{form-data-part.mjs → form-data-part.js} +0 -0
- /package/src/http-server/client/request-buffer/{header.mjs → header.js} +0 -0
- /package/src/http-server/client/{response.mjs → response.js} +0 -0
- /package/src/{logger.mjs → logger.js} +0 -0
- /package/src/spec/{index.mjs → index.js} +0 -0
- /package/src/utils/{file-exists.mjs → file-exists.js} +0 -0
- /package/src/utils/{rest-args-error.mjs → rest-args-error.js} +0 -0
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import {digg} from "diggerize"
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
import AlterTable from "../sqlite/sql/alter-table.js"
|
|
4
|
+
import Base from "../base.js"
|
|
5
|
+
import CreateIndex from "../sqlite/sql/create-index.js"
|
|
6
|
+
import CreateTable from "../sqlite/sql/create-table.js"
|
|
7
|
+
import Delete from "../sqlite/sql/delete.js"
|
|
7
8
|
import escapeString from "sql-string-escape"
|
|
8
|
-
import Insert from "../sqlite/sql/insert.
|
|
9
|
-
import Options from "../sqlite/options.
|
|
10
|
-
import QueryParser from "../sqlite/query-parser.
|
|
9
|
+
import Insert from "../sqlite/sql/insert.js"
|
|
10
|
+
import Options from "../sqlite/options.js"
|
|
11
|
+
import QueryParser from "../sqlite/query-parser.js"
|
|
11
12
|
import Table from "./table"
|
|
12
|
-
import Update from "../sqlite/sql/update.
|
|
13
|
+
import Update from "../sqlite/sql/update.js"
|
|
13
14
|
|
|
14
15
|
export default class VelociousDatabaseDriversSqliteBase extends Base {
|
|
16
|
+
alterTableSql(columnData) {
|
|
17
|
+
const createArgs = Object.assign({driver: this}, columnData)
|
|
18
|
+
const alterTable = new AlterTable(createArgs)
|
|
19
|
+
|
|
20
|
+
return alterTable.toSqls()
|
|
21
|
+
}
|
|
22
|
+
|
|
15
23
|
createIndexSql(indexData) {
|
|
16
24
|
const createArgs = Object.assign({driver: this}, indexData)
|
|
17
25
|
const createIndex = new CreateIndex(createArgs)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Configuration from "../configuration.
|
|
1
|
+
import Configuration from "../configuration.js"
|
|
2
2
|
import * as inflection from "inflection"
|
|
3
3
|
import Migrator from "./migrator"
|
|
4
4
|
|
|
@@ -14,13 +14,13 @@ export default class VelociousDatabaseMigrateFromRequireContext {
|
|
|
14
14
|
|
|
15
15
|
const files = requireContext.keys()
|
|
16
16
|
.map((file) => {
|
|
17
|
-
const match = file.match(/^\.\/(\d{14})-(.+)\.
|
|
17
|
+
const match = file.match(/^\.\/(\d{14})-(.+)\.js$/)
|
|
18
18
|
|
|
19
19
|
if (!match) return null
|
|
20
20
|
|
|
21
21
|
const date = parseInt(match[1])
|
|
22
22
|
const migrationName = match[2]
|
|
23
|
-
const migrationClassName = inflection.camelize(migrationName)
|
|
23
|
+
const migrationClassName = inflection.camelize(migrationName.replaceAll("-", "_"))
|
|
24
24
|
|
|
25
25
|
return {
|
|
26
26
|
file,
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
import TableData from "../table-data/index.
|
|
1
|
+
import TableData, {TableColumn} from "../table-data/index.js"
|
|
2
2
|
|
|
3
3
|
export default class VelociousDatabaseMigration {
|
|
4
4
|
constructor({configuration}) {
|
|
5
5
|
this.configuration = configuration
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
async addColumn(tableName, columnName, args) {
|
|
9
|
+
const databasePool = this.configuration.getDatabasePool()
|
|
10
|
+
const sqls = databasePool.alterTableSql({
|
|
11
|
+
columns: [new TableColumn(columnName, args)],
|
|
12
|
+
tableName
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
for (const sql of sqls) {
|
|
16
|
+
await databasePool.query(sql)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
8
20
|
async addIndex(tableName, columns, args) {
|
|
9
21
|
const databasePool = this.configuration.getDatabasePool()
|
|
10
22
|
const createIndexArgs = Object.assign(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Configuration from "../../configuration.
|
|
1
|
+
import Configuration from "../../configuration.js"
|
|
2
2
|
import {digg} from "diggerize"
|
|
3
3
|
|
|
4
4
|
class VelociousDatabasePoolBase {
|
|
@@ -35,6 +35,8 @@ class VelociousDatabasePoolBase {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
const forwardMethods = [
|
|
38
|
+
"alterTable",
|
|
39
|
+
"alterTableSql",
|
|
38
40
|
"createIndex",
|
|
39
41
|
"createIndexSql",
|
|
40
42
|
"createTable",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import QueryBase from "./base.js"
|
|
2
|
+
import restArgsError from "../../utils/rest-args-error.js"
|
|
3
|
+
|
|
4
|
+
export default class VelociousDatabaseQueryAlterTableBase extends QueryBase {
|
|
5
|
+
constructor({columns, driver, tableName, ...restArgs}) {
|
|
6
|
+
restArgsError(restArgs)
|
|
7
|
+
|
|
8
|
+
super({driver})
|
|
9
|
+
this.columns = columns
|
|
10
|
+
this.tableName = tableName
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
toSqls() {
|
|
14
|
+
const sqls = []
|
|
15
|
+
|
|
16
|
+
for (const column of this.columns) {
|
|
17
|
+
let sql = `ALTER TABLE ${this.driver.quoteTable(this.tableName)} ADD `
|
|
18
|
+
|
|
19
|
+
sql += this.driver.quoteColumn(column.getName())
|
|
20
|
+
|
|
21
|
+
sqls.push(sql)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return sqls
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import CreateIndexBase from "./create-index-base.
|
|
2
|
-
import QueryBase from "./base.
|
|
1
|
+
import CreateIndexBase from "./create-index-base.js"
|
|
2
|
+
import QueryBase from "./base.js"
|
|
3
3
|
|
|
4
4
|
export default class VelociousDatabaseQueryCreateTableBase extends QueryBase {
|
|
5
5
|
constructor({driver, ifNotExists, indexInCreateTable = true, tableData}) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import FromPlain from "./from-plain.
|
|
1
|
+
import FromPlain from "./from-plain.js"
|
|
2
2
|
import {incorporate} from "incorporator"
|
|
3
3
|
import * as inflection from "inflection"
|
|
4
|
-
import JoinPlain from "./join-plain.
|
|
5
|
-
import OrderPlain from "./order-plain.
|
|
6
|
-
import Preloader from "./preloader.
|
|
7
|
-
import SelectPlain from "./select-plain.
|
|
8
|
-
import WhereHash from "./where-hash.
|
|
9
|
-
import WherePlain from "./where-plain.
|
|
4
|
+
import JoinPlain from "./join-plain.js"
|
|
5
|
+
import OrderPlain from "./order-plain.js"
|
|
6
|
+
import Preloader from "./preloader.js"
|
|
7
|
+
import SelectPlain from "./select-plain.js"
|
|
8
|
+
import WhereHash from "./where-hash.js"
|
|
9
|
+
import WherePlain from "./where-plain.js"
|
|
10
10
|
|
|
11
11
|
export default class VelociousDatabaseQuery {
|
|
12
12
|
constructor({driver, froms = [], groups = [], joins = [], handler, limits = [], modelClass, orders = [], preload = {}, selects = [], wheres = []}) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as inflection from "inflection"
|
|
2
|
-
import restArgsError from "../../../utils/rest-args-error.
|
|
2
|
+
import restArgsError from "../../../utils/rest-args-error.js"
|
|
3
3
|
|
|
4
4
|
export default class VelociousDatabaseQueryPreloaderBelongsTo {
|
|
5
5
|
constructor({models, relationship, ...restArgs}) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as inflection from "inflection"
|
|
2
|
-
import restArgsError from "../../../utils/rest-args-error.
|
|
2
|
+
import restArgsError from "../../../utils/rest-args-error.js"
|
|
3
3
|
|
|
4
4
|
export default class VelociousDatabaseQueryPreloaderHasMany {
|
|
5
5
|
constructor({models, relationship, ...restArgs}) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import BelongsToPreloader from "./preloader/belongs-to.
|
|
2
|
-
import HasManyPreloader from "./preloader/has-many.
|
|
3
|
-
import restArgsError from "../../utils/rest-args-error.
|
|
1
|
+
import BelongsToPreloader from "./preloader/belongs-to.js"
|
|
2
|
+
import HasManyPreloader from "./preloader/has-many.js"
|
|
3
|
+
import restArgsError from "../../utils/rest-args-error.js"
|
|
4
4
|
|
|
5
5
|
export default class VelociousDatabaseQueryPreloader {
|
|
6
6
|
constructor({modelClass, models, preload, ...restArgs}) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {digs} from "diggerize"
|
|
2
|
-
import FromParser from "./from-parser.
|
|
3
|
-
import GroupParser from "./group-parser.
|
|
4
|
-
import JoinsParser from "./joins-parser.
|
|
5
|
-
import LimitParser from "./limit-parser.
|
|
6
|
-
import OrderParser from "./order-parser.
|
|
7
|
-
import SelectParser from "./select-parser.
|
|
8
|
-
import WhereParser from "./where-parser.
|
|
2
|
+
import FromParser from "./from-parser.js"
|
|
3
|
+
import GroupParser from "./group-parser.js"
|
|
4
|
+
import JoinsParser from "./joins-parser.js"
|
|
5
|
+
import LimitParser from "./limit-parser.js"
|
|
6
|
+
import OrderParser from "./order-parser.js"
|
|
7
|
+
import SelectParser from "./select-parser.js"
|
|
8
|
+
import WhereParser from "./where-parser.js"
|
|
9
9
|
|
|
10
10
|
export default class VelociousDatabaseBaseQueryParser {
|
|
11
11
|
constructor({pretty, query}) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import BelongsToInstanceRelationship from "./instance-relationships/belongs-to.
|
|
2
|
-
import BelongsToRelationship from "./relationships/belongs-to.
|
|
3
|
-
import Configuration from "../../configuration.
|
|
4
|
-
import FromTable from "../query/from-table.
|
|
5
|
-
import Handler from "../handler.
|
|
6
|
-
import HasManyRelationship from "./relationships/has-many.
|
|
7
|
-
import HasManyInstanceRelationship from "./instance-relationships/has-many.
|
|
1
|
+
import BelongsToInstanceRelationship from "./instance-relationships/belongs-to.js"
|
|
2
|
+
import BelongsToRelationship from "./relationships/belongs-to.js"
|
|
3
|
+
import Configuration from "../../configuration.js"
|
|
4
|
+
import FromTable from "../query/from-table.js"
|
|
5
|
+
import Handler from "../handler.js"
|
|
6
|
+
import HasManyRelationship from "./relationships/has-many.js"
|
|
7
|
+
import HasManyInstanceRelationship from "./instance-relationships/has-many.js"
|
|
8
8
|
import * as inflection from "inflection"
|
|
9
|
-
import Query from "../query/index.
|
|
10
|
-
import RecordNotFoundError from "./record-not-found-error.
|
|
9
|
+
import Query from "../query/index.js"
|
|
10
|
+
import RecordNotFoundError from "./record-not-found-error.js"
|
|
11
11
|
|
|
12
12
|
export default class VelociousDatabaseRecord {
|
|
13
13
|
static _relationshipExists(relationshipName) {
|
|
@@ -3,6 +3,8 @@ class TableColumn {
|
|
|
3
3
|
this.args = args
|
|
4
4
|
this.name = name
|
|
5
5
|
}
|
|
6
|
+
|
|
7
|
+
getName = () => this.name
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
class TableIndex {
|
|
@@ -23,6 +25,8 @@ class TableReference {
|
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
|
|
28
|
+
export {TableColumn}
|
|
29
|
+
|
|
26
30
|
export default class TableData {
|
|
27
31
|
_columns = []
|
|
28
32
|
_indexes = []
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {digg} from "diggerize"
|
|
2
2
|
import {EventEmitter} from "events"
|
|
3
|
-
import logger from "../../logger.
|
|
4
|
-
import Request from "./request.
|
|
5
|
-
import RequestRunner from "./request-runner.
|
|
3
|
+
import logger from "../../logger.js"
|
|
4
|
+
import Request from "./request.js"
|
|
5
|
+
import RequestRunner from "./request-runner.js"
|
|
6
6
|
|
|
7
7
|
export default class VeoliciousHttpServerClient {
|
|
8
8
|
events = new EventEmitter()
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {EventEmitter} from "events"
|
|
2
|
-
import FormDataPart from "./form-data-part.
|
|
3
|
-
import Header from "./header.
|
|
2
|
+
import FormDataPart from "./form-data-part.js"
|
|
3
|
+
import Header from "./header.js"
|
|
4
4
|
import Incorporator from "incorporator"
|
|
5
|
-
import logger from "../../../logger.
|
|
6
|
-
import ParamsToObject from "../params-to-object.
|
|
5
|
+
import logger from "../../../logger.js"
|
|
6
|
+
import ParamsToObject from "../params-to-object.js"
|
|
7
7
|
import querystring from "querystring"
|
|
8
8
|
|
|
9
9
|
export default class RequestBuffer {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {digg} from "diggerize"
|
|
2
2
|
import {EventEmitter} from "events"
|
|
3
3
|
import Incorporator from "incorporator"
|
|
4
|
-
import ParamsToObject from "./params-to-object.
|
|
5
|
-
import RequestBuffer from "./request-buffer/index.
|
|
4
|
+
import ParamsToObject from "./params-to-object.js"
|
|
5
|
+
import RequestBuffer from "./request-buffer/index.js"
|
|
6
6
|
|
|
7
7
|
export default class VelociousHttpServerClientRequestParser {
|
|
8
8
|
constructor({configuration}) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import EventEmitter from "events"
|
|
2
|
-
import logger from "../../logger.
|
|
3
|
-
import Response from "./response.
|
|
4
|
-
import RoutesResolver from "../../routes/resolver.
|
|
2
|
+
import logger from "../../logger.js"
|
|
3
|
+
import Response from "./response.js"
|
|
4
|
+
import RoutesResolver from "../../routes/resolver.js"
|
|
5
5
|
|
|
6
6
|
export default class VelociousHttpServerClientRequestRunner {
|
|
7
7
|
events = new EventEmitter()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {digg} from "diggerize"
|
|
2
|
-
import logger from "../logger.
|
|
2
|
+
import logger from "../logger.js"
|
|
3
3
|
import Net from "net"
|
|
4
|
-
import ServerClient from "./server-client.
|
|
5
|
-
import WorkerHandler from "./worker-handler/index.
|
|
4
|
+
import ServerClient from "./server-client.js"
|
|
5
|
+
import WorkerHandler from "./worker-handler/index.js"
|
|
6
6
|
|
|
7
7
|
export default class VelociousHttpServer {
|
|
8
8
|
clientCount = 0
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {digg, digs} from "diggerize"
|
|
2
2
|
import {dirname} from "path"
|
|
3
3
|
import {fileURLToPath} from "url"
|
|
4
|
-
import logger from "../../logger.
|
|
4
|
+
import logger from "../../logger.js"
|
|
5
5
|
import {Worker} from "worker_threads"
|
|
6
6
|
|
|
7
7
|
export default class VelociousHttpServerWorker {
|
|
@@ -19,7 +19,7 @@ export default class VelociousHttpServerWorker {
|
|
|
19
19
|
const __dirname = dirname(__filename)
|
|
20
20
|
|
|
21
21
|
this.onStartCallback = resolve
|
|
22
|
-
this.worker = new Worker(`${__dirname}/worker-script.
|
|
22
|
+
this.worker = new Worker(`${__dirname}/worker-script.js`, {
|
|
23
23
|
workerData: {
|
|
24
24
|
debug,
|
|
25
25
|
directory,
|