@smuzi/database 0.0.1 → 0.0.2

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.
@@ -1,3 +1,3 @@
1
- import { TDatabaseService } from "#lib/types.js";
1
+ import { TDatabaseService } from "../../types.js";
2
2
  import { TOutputConsole } from "@smuzi/console";
3
3
  export default function (service: TDatabaseService): (output: TOutputConsole, params: any) => Promise<void>;
@@ -1,4 +1,4 @@
1
- import run from "#lib/commands/migrations/run.js";
1
+ import run from "./run.js";
2
2
  export default function (service) {
3
3
  return async (output, params) => {
4
4
  output.success('Drop all tables...');
@@ -1,3 +1,3 @@
1
- import { TDatabaseService } from "#lib/types.js";
1
+ import { TDatabaseService } from "../../types.js";
2
2
  import { TOutputConsole } from "@smuzi/console";
3
3
  export default function (service: TDatabaseService): (output: TOutputConsole, params: any) => Promise<void>;
@@ -1,5 +1,5 @@
1
- import { clearSQL } from "#lib/helpers.js";
2
- import { TMigrationLogAction } from "#lib/migration.js";
1
+ import { clearSQL } from "../../helpers.js";
2
+ import { TMigrationLogAction } from "../../migration.js";
3
3
  export default function (service) {
4
4
  return async (output, params) => {
5
5
  const migrationsLogRepository = service.buildMigrationLogRepository(service.client);
@@ -1,3 +1,3 @@
1
- import { TDatabaseService } from "#lib/types.js";
1
+ import { TDatabaseService } from "../../types.js";
2
2
  import { TOutputConsole } from "@smuzi/console";
3
3
  export default function (service: TDatabaseService): (output: TOutputConsole, params: any) => Promise<void>;
@@ -1,5 +1,5 @@
1
- import { clearSQL } from "#lib/helpers.js";
2
- import { TMigrationLogAction } from "#lib/migration.js";
1
+ import { clearSQL } from "../../helpers.js";
2
+ import { TMigrationLogAction } from "../../migration.js";
3
3
  export default function (service) {
4
4
  return async (output, params) => {
5
5
  const migrationsLogRepository = service.buildMigrationLogRepository(service.client);
@@ -1,3 +1,3 @@
1
- import { TDatabaseService } from "#lib/types.js";
1
+ import { TDatabaseService } from "../../types.js";
2
2
  import { TOutputConsole } from "@smuzi/console";
3
3
  export default function (service: TDatabaseService): (output: TOutputConsole, params: any) => Promise<void>;
@@ -1,5 +1,5 @@
1
- import { clearSQL } from "#lib/helpers.js";
2
- import { TMigrationLogAction } from "#lib/migration.js";
1
+ import { clearSQL } from "../../helpers.js";
2
+ import { TMigrationLogAction } from "../../migration.js";
3
3
  export default function (service) {
4
4
  return async (output, params) => {
5
5
  const migrationsLogRepository = service.buildMigrationLogRepository(service.client);
@@ -1,8 +1,8 @@
1
1
  import { CreateConsoleRouter } from "@smuzi/console";
2
- import migrationsRun from "#lib/commands/migrations/run.js";
3
- import migrationsRollback from "#lib/commands/migrations/rollback.js";
4
- import migrationsRefresh from "#lib/commands/migrations/refresh.js";
5
- import migrationsFresh from "#lib/commands/migrations/fresh.js";
2
+ import migrationsRun from "./migrations/run.js";
3
+ import migrationsRollback from "./migrations/rollback.js";
4
+ import migrationsRefresh from "./migrations/refresh.js";
5
+ import migrationsFresh from "./migrations/fresh.js";
6
6
  export const databaseConsole = (config) => {
7
7
  const router = CreateConsoleRouter('db:');
8
8
  const routerMigrations = CreateConsoleRouter('migrations:');
package/build/config.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { TDatabaseService } from "#lib/types.js";
1
+ import { TDatabaseService } from "./types.js";
2
2
  export declare function DatabaseConfig(config: TDatabaseService): Readonly<TDatabaseService>;
@@ -1,5 +1,5 @@
1
1
  import { Result } from "@smuzi/std";
2
- import { TQueryParams } from "#lib/types.js";
2
+ import { TQueryParams } from "./types.js";
3
3
  export declare function clearSQL(sql: string): string;
4
4
  export declare function preparedSqlFromObjectToArrayParams(sql: string, params: TQueryParams): Result<{
5
5
  sql: string;
package/build/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from "#lib/migration.js";
2
- export * from "#lib/commands/router.js";
3
- export * from "#lib/config.js";
4
- export * from "#lib/types.js";
5
- export * from "#lib/helpers.js";
1
+ export * from "./migration.js";
2
+ export * from "./commands/router.js";
3
+ export * from "./config.js";
4
+ export * from "./types.js";
5
+ export * from "./helpers.js";
package/build/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export * from "#lib/migration.js";
2
- export * from "#lib/commands/router.js";
3
- export * from "#lib/config.js";
4
- export * from "#lib/types.js";
5
- export * from "#lib/helpers.js";
1
+ export * from "./migration.js";
2
+ export * from "./commands/router.js";
3
+ export * from "./config.js";
4
+ export * from "./types.js";
5
+ export * from "./helpers.js";
@@ -1,4 +1,4 @@
1
- import { TInsertRow, TInsertRowResult, TQueryResult } from "#lib/types.js";
1
+ import { TInsertRow, TInsertRowResult, TQueryResult } from "./types.js";
2
2
  import { Option } from "@smuzi/std";
3
3
  import { SchemaObject } from "@smuzi/schema";
4
4
  export declare const migrationLogRowSchema: SchemaObject<{
package/build/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Option, RecordFromKeys, Result, Simplify, StdError, StdRecord } from "@smuzi/std";
2
2
  import { SchemaObject, SchemaStorageAutoNumber } from "@smuzi/schema";
3
- import { TMigrations, TMigrationsLogRepository } from "#lib/migration.js";
3
+ import { TMigrations, TMigrationsLogRepository } from "./migration.js";
4
4
  export type TQueryParams = unknown[] | Record<string, unknown>;
5
5
  export declare class DBQueryError {
6
6
  readonly sql: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smuzi/database",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Database access layer and migrations toolkit for JavaScript and TypeScript",
5
5
  "type": "module",
6
6
  "types": "./build/index.d.ts",
@@ -20,16 +20,22 @@
20
20
  ],
21
21
  "exports": {
22
22
  "./package.json": "./package.json",
23
- ".": "./src/index.ts",
24
- "./*": "./src/*.ts"
23
+ ".": {
24
+ "types": "./build/index.d.ts",
25
+ "default": "./build/index.js"
26
+ },
27
+ "./*": {
28
+ "types": "./build/*.d.ts",
29
+ "default": "./build/*.js"
30
+ }
25
31
  },
26
32
  "imports": {
27
33
  "#lib/*": "./src/*"
28
34
  },
29
35
  "dependencies": {
30
- "@smuzi/std": "0.2.4",
31
- "@smuzi/schema": "0.0.2",
32
- "@smuzi/console": "0.0.1"
36
+ "@smuzi/std": "0.2.6",
37
+ "@smuzi/schema": "0.0.4",
38
+ "@smuzi/console": "0.0.3"
33
39
  },
34
40
  "devDependencies": {
35
41
  "@types/node": "^22.15.21",
@@ -1,6 +1,6 @@
1
- import {TDatabaseService} from "#lib/types.js";
1
+ import {TDatabaseService} from "../../types.js";
2
2
  import {TOutputConsole} from "@smuzi/console";
3
- import run from "#lib/commands/migrations/run.js";
3
+ import run from "./run.js";
4
4
  import {Ok, OkOrNullableAsError, OptionFromNullable} from "@smuzi/std";
5
5
 
6
6
  export default function (service: TDatabaseService) {
@@ -1,8 +1,8 @@
1
- import {TDatabaseService } from "#lib/types.js";
1
+ import {TDatabaseService } from "../../types.js";
2
2
  import {TOutputConsole} from "@smuzi/console";
3
3
  import {Ok, OkOrNullableAsError, OptionFromNullable} from "@smuzi/std";
4
- import {clearSQL} from "#lib/helpers.js";
5
- import {TMigrationLogAction} from "#lib/migration.js";
4
+ import {clearSQL} from "../../helpers.js";
5
+ import {TMigrationLogAction} from "../../migration.js";
6
6
 
7
7
  export default function (service: TDatabaseService) {
8
8
  return async (output: TOutputConsole, params) => {
@@ -1,8 +1,8 @@
1
- import {TDatabaseService} from "#lib/types.js";
1
+ import {TDatabaseService} from "../../types.js";
2
2
  import {Ok, OkOrNullableAsError, OptionFromNullable} from "@smuzi/std";
3
3
  import {TOutputConsole} from "@smuzi/console";
4
- import {clearSQL} from "#lib/helpers.js";
5
- import {TMigrationLogAction} from "#lib/migration.js";
4
+ import {clearSQL} from "../../helpers.js";
5
+ import {TMigrationLogAction} from "../../migration.js";
6
6
 
7
7
  export default function (service: TDatabaseService) {
8
8
  return async (output: TOutputConsole, params) => {
@@ -1,8 +1,8 @@
1
- import {TDatabaseService} from "#lib/types.js";
1
+ import {TDatabaseService} from "../../types.js";
2
2
  import {Ok, OkOrNullableAsError, OptionFromNullable} from "@smuzi/std";
3
3
  import {TOutputConsole} from "@smuzi/console";
4
- import {clearSQL} from "#lib/helpers.js";
5
- import {TMigrationLogAction} from "#lib/migration.js";
4
+ import {clearSQL} from "../../helpers.js";
5
+ import {TMigrationLogAction} from "../../migration.js";
6
6
 
7
7
  export default function (service: TDatabaseService) {
8
8
  return async (output: TOutputConsole, params) => {
@@ -1,8 +1,8 @@
1
1
  import {CreateConsoleRouter} from "@smuzi/console";
2
- import migrationsRun from "#lib/commands/migrations/run.js";
3
- import migrationsRollback from "#lib/commands/migrations/rollback.js";
4
- import migrationsRefresh from "#lib/commands/migrations/refresh.js";
5
- import migrationsFresh from "#lib/commands/migrations/fresh.js";
2
+ import migrationsRun from "./migrations/run.js";
3
+ import migrationsRollback from "./migrations/rollback.js";
4
+ import migrationsRefresh from "./migrations/refresh.js";
5
+ import migrationsFresh from "./migrations/fresh.js";
6
6
 
7
7
 
8
8
  export const databaseConsole = (config) => {
package/src/config.ts CHANGED
@@ -1,4 +1,4 @@
1
- import {TDatabaseService} from "#lib/types.js";
1
+ import {TDatabaseService} from "./types.js";
2
2
  import {readonly} from "@smuzi/std";
3
3
 
4
4
  export function DatabaseConfig(config: TDatabaseService) {
package/src/helpers.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import {dump, Err, isEmpty, isOption, Ok, Result} from "@smuzi/std";
2
- import {TQueryParams} from "#lib/types.js";
2
+ import {TQueryParams} from "./types.js";
3
3
 
4
4
  export function clearSQL(sql: string): string
5
5
  {
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from "#lib/migration.js"
2
- export * from "#lib/commands/router.js"
3
- export * from "#lib/config.js"
4
- export * from "#lib/types.js"
5
- export * from "#lib/helpers.js"
1
+ export * from "./migration.js"
2
+ export * from "./commands/router.js"
3
+ export * from "./config.js"
4
+ export * from "./types.js"
5
+ export * from "./helpers.js"
package/src/migration.ts CHANGED
@@ -1,4 +1,4 @@
1
- import {TInsertRow, TInsertRowResult, TQueryResult,} from "#lib/types.js";
1
+ import {TInsertRow, TInsertRowResult, TQueryResult,} from "./types.js";
2
2
  import {Option, panic} from "@smuzi/std";
3
3
  import {schema, SchemaObject} from "@smuzi/schema";
4
4
 
package/src/types.ts CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  SchemaRule,
18
18
  SchemaStorageAutoNumber,
19
19
  } from "@smuzi/schema"
20
- import {TMigrations, TMigrationsLogRepository} from "#lib/migration.js";
20
+ import {TMigrations, TMigrationsLogRepository} from "./migration.js";
21
21
 
22
22
  export type TQueryParams = unknown[] | Record<string, unknown>
23
23