@ez4/database 0.11.0 → 0.13.0

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Silas B.
3
+ Copyright (c) 2025 Silas B.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -57,6 +57,9 @@ export declare namespace Query {
57
57
  where?: WhereInput<T, {}, R>;
58
58
  limit?: number;
59
59
  };
60
+ export type CountInput<T extends Database.Schema, R extends RelationMetadata> = {
61
+ where?: WhereInput<T, {}, R>;
62
+ };
60
63
  export type InsertOneResult = void;
61
64
  export type UpdateOneResult<T extends Database.Schema, S extends AnyObject, R extends RelationMetadata> = Record<T, S, R> | undefined;
62
65
  export type FindOneResult<T extends Database.Schema, S extends AnyObject, R extends RelationMetadata> = Record<T, S, R> | undefined;
@@ -82,4 +82,10 @@ export interface Table<T extends Database.Schema, I extends Database.Indexes<T>,
82
82
  * @param query Input query.
83
83
  */
84
84
  deleteMany<S extends Query.SelectInput<T, R>>(query: Query.DeleteManyInput<T, S, R>): Promise<Query.DeleteManyResult<T, S, R>>;
85
+ /**
86
+ * Count database records.
87
+ *
88
+ * @param query Input query.
89
+ */
90
+ count(query: Query.CountInput<T, R>): Promise<number>;
85
91
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ez4/database",
3
3
  "description": "EZ4: Components to build database services",
4
- "version": "0.11.0",
4
+ "version": "0.13.0",
5
5
  "author": "Silas B.",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -41,13 +41,11 @@
41
41
  "clean:registry": "rm -rf ../../.registry/@ez4/database",
42
42
  "live:publish": "npm run test && npm publish --access public"
43
43
  },
44
- "peerDependencies": {
45
- "@ez4/project": "^0.11.0"
46
- },
47
44
  "dependencies": {
48
- "@ez4/common": "^0.11.0",
49
- "@ez4/reflection": "^0.11.0",
50
- "@ez4/schema": "^0.11.0",
51
- "@ez4/utils": "^0.11.0"
45
+ "@ez4/common": "^0.13.0",
46
+ "@ez4/project": "^0.13.0",
47
+ "@ez4/reflection": "^0.13.0",
48
+ "@ez4/schema": "^0.13.0",
49
+ "@ez4/utils": "^0.13.0"
52
50
  }
53
51
  }