@sprucelabs/data-stores 28.1.340 → 28.1.342

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/README.md CHANGED
@@ -1,24 +1,201 @@
1
- <img src="https://raw.githubusercontent.com/sprucelabsai/data-stores/master/docs/images/hero.jpg">
2
-
3
- <h1 align="center">
4
- Spruce XP Documentation
5
- </h1>
6
- <h3 align="center">Spruce XP is an Experience Platform built to create unforgettable experiences and long-lasting relationships.
7
- </h3>
8
- <p align="center">
9
- <img align="center" width="80%" src="https://raw.githubusercontent.com/sprucelabsai/data-stores/master/docs/images/bullets.jpg">
10
- </p>
11
- <img src="https://raw.githubusercontent.com/sprucelabsai/data-stores/master/docs/images/spacer.png">
12
- <br />
13
- <p align="center">
14
- <img align="center" width="80%" src="https://raw.githubusercontent.com/sprucelabsai/data-stores/master/docs/images/sprucebot-message.png">
15
- </p>
16
- <br />
17
-
18
- <p align="center">
19
- <a href="https://developer.spruce.ai/#/"><img width="250" src="https://raw.githubusercontent.com/sprucelabsai/data-stores/master/docs/images/read-full-docs.png" /></a>
20
- </p>
21
-
22
- ### Dependencies
23
-
24
- [Arkit diagram here](docs/dependencies.md).
1
+ # Data Stores
2
+
3
+ ## All assertions are assuming the following structure
4
+
5
+ ```sql
6
+ --
7
+ -- PostgreSQL database dump
8
+ --
9
+
10
+ -- Dumped from database version 14.7 (Homebrew)
11
+ -- Dumped by pg_dump version 14.7 (Homebrew)
12
+
13
+ SET statement_timeout = 0;
14
+ SET lock_timeout = 0;
15
+ SET idle_in_transaction_session_timeout = 0;
16
+ SET client_encoding = 'UTF8';
17
+ SET standard_conforming_strings = on;
18
+ SELECT pg_catalog.set_config('search_path', '', false);
19
+ SET check_function_bodies = false;
20
+ SET xmloption = content;
21
+ SET client_min_messages = warning;
22
+ SET row_security = off;
23
+
24
+ SET default_tablespace = '';
25
+
26
+ SET default_table_access_method = heap;
27
+
28
+ -- start with dropping tables
29
+ DROP TABLE IF EXISTS public.test_collection CASCADE;
30
+ DROP TABLE IF EXISTS public."user" CASCADE;
31
+ DROP SEQUENCE IF EXISTS public.test_collection_id_seq CASCADE;
32
+
33
+ --
34
+ -- Name: test_collection; Type: TABLE; Schema: public; Owner: taylorromero
35
+ --
36
+
37
+ CREATE TABLE public.test_collection (
38
+ id integer NOT NULL,
39
+ name character varying NOT NULL,
40
+ count integer,
41
+ "isPublic" boolean,
42
+ number integer,
43
+ names varchar(255)[],
44
+ "uniqueField" character varying,
45
+ "uniqueField2" character varying,
46
+ "uniqueField3" character varying,
47
+ "uniqueField4" character varying,
48
+ "someField" character varying,
49
+ "someField2" character varying,
50
+ "someField3" character varying,
51
+ "otherField" character varying,
52
+ "otherField2" character varying,
53
+ "someOtherField" character varying,
54
+ "randomUniqueField" character varying,
55
+ target jsonb,
56
+ slug character varying,
57
+ "aNonIndexedField" boolean,
58
+ "undefinedField" character varying,
59
+ "nullField" character varying
60
+ );
61
+
62
+
63
+ ALTER TABLE public.test_collection OWNER TO taylorromero;
64
+
65
+ --
66
+ -- Name: test_collection_id_seq; Type: SEQUENCE; Schema: public; Owner: taylorromero
67
+ --
68
+
69
+ CREATE SEQUENCE public.test_collection_id_seq
70
+ AS integer
71
+ START WITH 1
72
+ INCREMENT BY 1
73
+ NO MINVALUE
74
+ NO MAXVALUE
75
+ CACHE 1;
76
+
77
+
78
+ --
79
+ -- Name: test_collection_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: taylorromero
80
+ --
81
+
82
+ ALTER SEQUENCE public.test_collection_id_seq OWNED BY public.test_collection.id;
83
+
84
+
85
+ --
86
+ -- Name: user; Type: TABLE; Schema: public; Owner: taylorromero
87
+ --
88
+
89
+ CREATE TABLE public."user" (
90
+ id integer NOT NULL,
91
+ name character varying NOT NULL,
92
+ count integer,
93
+ "isPublic" boolean,
94
+ number integer,
95
+ names varchar(255)[],
96
+ "uniqueField" character varying,
97
+ "uniqueField2" character varying,
98
+ "uniqueField3" character varying,
99
+ "uniqueField4" character varying,
100
+ "someField" character varying,
101
+ "someField2" character varying,
102
+ "someField3" character varying,
103
+ "otherField" character varying,
104
+ "otherField2" character varying,
105
+ "someOtherField" character varying,
106
+ "randomUniqueField" character varying,
107
+ target jsonb,
108
+ slug character varying,
109
+ "aNonIndexedField" boolean,
110
+ "undefinedField" character varying,
111
+ "nullField" character varying
112
+ );
113
+
114
+
115
+ --
116
+ -- Name: user_id_seq; Type: SEQUENCE; Schema: public; Owner: taylorromero
117
+ --
118
+
119
+ CREATE SEQUENCE public.user_id_seq
120
+ AS integer
121
+ START WITH 1
122
+ INCREMENT BY 1
123
+ NO MINVALUE
124
+ NO MAXVALUE
125
+ CACHE 1;
126
+
127
+
128
+
129
+ --
130
+ -- Name: user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: taylorromero
131
+ --
132
+
133
+ ALTER SEQUENCE public.user_id_seq OWNED BY public."user".id;
134
+
135
+
136
+ --
137
+ -- Name: test_collection id; Type: DEFAULT; Schema: public; Owner: taylorromero
138
+ --
139
+
140
+ ALTER TABLE ONLY public.test_collection ALTER COLUMN id SET DEFAULT nextval('public.test_collection_id_seq'::regclass);
141
+
142
+
143
+ --
144
+ -- Name: user id; Type: DEFAULT; Schema: public; Owner: taylorromero
145
+ --
146
+
147
+ ALTER TABLE ONLY public."user" ALTER COLUMN id SET DEFAULT nextval('public.user_id_seq'::regclass);
148
+
149
+
150
+ --
151
+ -- Data for Name: test_collection; Type: TABLE DATA; Schema: public; Owner: taylorromero
152
+ --
153
+
154
+ COPY public.test_collection (id, name, count, "isPublic", number, names, "uniqueField", "uniqueField2", "uniqueField3", "uniqueField4", "someField", "someField2", "someField3", "otherField", "otherField2", "someOtherField", "randomUniqueField", target, slug, "aNonIndexedField", "undefinedField", "nullField") FROM stdin;
155
+ \.
156
+
157
+
158
+ --
159
+ -- Data for Name: user; Type: TABLE DATA; Schema: public; Owner: taylorromero
160
+ --
161
+
162
+ COPY public."user" (id, name, count, "isPublic", number, names, "uniqueField", "uniqueField2", "uniqueField3", "uniqueField4", "someField", "someField2", "someField3", "otherField", "otherField2", "someOtherField", "randomUniqueField", target, slug, "aNonIndexedField", "undefinedField", "nullField") FROM stdin;
163
+ \.
164
+
165
+
166
+ --
167
+ -- Name: test_collection_id_seq; Type: SEQUENCE SET; Schema: public; Owner: taylorromero
168
+ --
169
+
170
+ SELECT pg_catalog.setval('public.test_collection_id_seq', 1, false);
171
+
172
+
173
+ --
174
+ -- Name: user_id_seq; Type: SEQUENCE SET; Schema: public; Owner: taylorromero
175
+ --
176
+
177
+ SELECT pg_catalog.setval('public.user_id_seq', 1, false);
178
+
179
+
180
+ --
181
+ -- Name: test_collection test_collection_pk; Type: CONSTRAINT; Schema: public; Owner: taylorromero
182
+ --
183
+
184
+ ALTER TABLE ONLY public.test_collection
185
+ ADD CONSTRAINT test_collection_pk PRIMARY KEY (id);
186
+
187
+
188
+ --
189
+ -- Name: user user_pk; Type: CONSTRAINT; Schema: public; Owner: taylorromero
190
+ --
191
+
192
+ ALTER TABLE ONLY public."user"
193
+ ADD CONSTRAINT user_pk PRIMARY KEY (id);
194
+
195
+
196
+ --
197
+ -- PostgreSQL database dump complete
198
+ --
199
+
200
+
201
+ ```
@@ -757,7 +757,7 @@ const databaseAssertUtil = {
757
757
  yield db.syncUniqueIndexes(this.collectionName, [
758
758
  {
759
759
  fields: ['uniqueField'],
760
- filter: { isActive: true },
760
+ filter: { isPublic: true },
761
761
  },
762
762
  ]);
763
763
  yield db.syncUniqueIndexes(this.collectionName, [
@@ -767,7 +767,7 @@ const databaseAssertUtil = {
767
767
  },
768
768
  {
769
769
  fields: ['uniqueField'],
770
- filter: { isActive: true },
770
+ filter: { isPublic: true },
771
771
  },
772
772
  ]);
773
773
  indexes = yield db.getUniqueIndexes(this.collectionName);
@@ -805,7 +805,7 @@ const databaseAssertUtil = {
805
805
  ['someField'],
806
806
  ]);
807
807
  indexes = yield db.getUniqueIndexes(this.collectionName);
808
- assert.isLength(indexes, 2, 'There should still be 2 indexes after syncing.');
808
+ assert.isLength(indexes, 2, 'There should still be 2 indexes after this syncUniqueIndexs(). First sync was a single field unique index, second sync was two indexes, but one was already there. So one should have been ignored, one should have been added.');
809
809
  yield this.shutdown(db);
810
810
  });
811
811
  },
@@ -690,7 +690,7 @@ const databaseAssertUtil = {
690
690
  await db.syncUniqueIndexes(this.collectionName, [
691
691
  {
692
692
  fields: ['uniqueField'],
693
- filter: { isActive: true },
693
+ filter: { isPublic: true },
694
694
  },
695
695
  ]);
696
696
  await db.syncUniqueIndexes(this.collectionName, [
@@ -700,7 +700,7 @@ const databaseAssertUtil = {
700
700
  },
701
701
  {
702
702
  fields: ['uniqueField'],
703
- filter: { isActive: true },
703
+ filter: { isPublic: true },
704
704
  },
705
705
  ]);
706
706
  indexes = await db.getUniqueIndexes(this.collectionName);
@@ -734,7 +734,7 @@ const databaseAssertUtil = {
734
734
  ['someField'],
735
735
  ]);
736
736
  indexes = await db.getUniqueIndexes(this.collectionName);
737
- test_utils_1.assert.isLength(indexes, 2, 'There should still be 2 indexes after syncing.');
737
+ test_utils_1.assert.isLength(indexes, 2, 'There should still be 2 indexes after this syncUniqueIndexs(). First sync was a single field unique index, second sync was two indexes, but one was already there. So one should have been ignored, one should have been added.');
738
738
  await this.shutdown(db);
739
739
  },
740
740
  async assertCantDropCompoundUniqueIndexThatDoesntExist(connect) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "28.1.340",
6
+ "version": "28.1.342",
7
7
  "files": [
8
8
  "build/**/*",
9
9
  "!build/__tests__",