@rwillians/qx 0.1.4 → 0.1.5

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/dist/cjs/index.js CHANGED
@@ -69,6 +69,14 @@ class ColumnPropsBuilder {
69
69
  throw new Error('Cannot make a nullable column a primary key');
70
70
  return new ColumnPropsBuilder({ ...this.props, primaryKey: true });
71
71
  }
72
+ /**
73
+ * @public Marks the column as unique.
74
+ * @since 0.1.0
75
+ * @version 1
76
+ */
77
+ unique() {
78
+ return new ColumnPropsBuilder({ ...this.props, unique: true });
79
+ }
72
80
  }
73
81
  /**
74
82
  * @public A way to define a column with a custom standard schema.
package/dist/esm/index.js CHANGED
@@ -66,6 +66,14 @@ class ColumnPropsBuilder {
66
66
  throw new Error('Cannot make a nullable column a primary key');
67
67
  return new ColumnPropsBuilder({ ...this.props, primaryKey: true });
68
68
  }
69
+ /**
70
+ * @public Marks the column as unique.
71
+ * @since 0.1.0
72
+ * @version 1
73
+ */
74
+ unique() {
75
+ return new ColumnPropsBuilder({ ...this.props, unique: true });
76
+ }
69
77
  }
70
78
  /**
71
79
  * @public A way to define a column with a custom standard schema.
@@ -299,6 +299,14 @@ declare class ColumnPropsBuilder<T extends ColumnProps = ColumnProps> {
299
299
  primaryKey(): ColumnPropsBuilder<Expand<T & {
300
300
  primaryKey: true;
301
301
  }>>;
302
+ /**
303
+ * @public Marks the column as unique.
304
+ * @since 0.1.0
305
+ * @version 1
306
+ */
307
+ unique(): ColumnPropsBuilder<Expand<T & {
308
+ unique: true;
309
+ }>>;
302
310
  }
303
311
  /**
304
312
  * @public Built-in column types.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rwillians/qx",
3
3
  "description": "A teeny tiny ORM for SQLite.",
4
- "version": "0.1.4",
4
+ "version": "0.1.5",
5
5
  "author": "Rafael Willians <me@rwillians.com>",
6
6
  "license": "MIT",
7
7
  "repository": {