@pgpm/faker 0.4.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.
Files changed (27) hide show
  1. package/LICENSE +22 -0
  2. package/Makefile +6 -0
  3. package/README.md +438 -0
  4. package/__tests__/faker.test.ts +135 -0
  5. package/deploy/schemas/faker/procedures/utils.sql +740 -0
  6. package/deploy/schemas/faker/schema.sql +8 -0
  7. package/deploy/schemas/faker/tables/cities/fixtures/1602987351008_fixture.sql +3700 -0
  8. package/deploy/schemas/faker/tables/cities/table.sql +29 -0
  9. package/deploy/schemas/faker/tables/dictionary/fixtures/1602969089665_fixture.sql +6036 -0
  10. package/deploy/schemas/faker/tables/dictionary/table.sql +17 -0
  11. package/jest.config.js +15 -0
  12. package/launchql-faker.control +8 -0
  13. package/launchql.plan +10 -0
  14. package/package.json +29 -0
  15. package/revert/schemas/faker/procedures/utils.sql +51 -0
  16. package/revert/schemas/faker/schema.sql +7 -0
  17. package/revert/schemas/faker/tables/cities/fixtures/1602987351008_fixture.sql +5 -0
  18. package/revert/schemas/faker/tables/cities/table.sql +7 -0
  19. package/revert/schemas/faker/tables/dictionary/fixtures/1602969089665_fixture.sql +5 -0
  20. package/revert/schemas/faker/tables/dictionary/table.sql +7 -0
  21. package/sql/launchql-faker--0.4.6.sql +10408 -0
  22. package/verify/schemas/faker/procedures/utils.sql +47 -0
  23. package/verify/schemas/faker/schema.sql +7 -0
  24. package/verify/schemas/faker/tables/cities/fixtures/1602987351008_fixture.sql +5 -0
  25. package/verify/schemas/faker/tables/cities/table.sql +7 -0
  26. package/verify/schemas/faker/tables/dictionary/fixtures/1602969089665_fixture.sql +5 -0
  27. package/verify/schemas/faker/tables/dictionary/table.sql +7 -0
@@ -0,0 +1,17 @@
1
+ -- Deploy schemas/faker/tables/dictionary/table to pg
2
+
3
+ -- requires: schemas/faker/schema
4
+
5
+ BEGIN;
6
+
7
+ CREATE TABLE faker.dictionary (
8
+ id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (),
9
+ type text,
10
+ word text
11
+ );
12
+
13
+ CREATE INDEX faker_type_idx ON faker.dictionary (
14
+ type
15
+ );
16
+
17
+ COMMIT;
package/jest.config.js ADDED
@@ -0,0 +1,15 @@
1
+ /** @type {import('ts-jest').JestConfigWithTsJest} */
2
+ module.exports = {
3
+ preset: 'ts-jest',
4
+ testEnvironment: 'node',
5
+
6
+ // Match both __tests__ and colocated test files
7
+ testMatch: ['**/?(*.)+(test|spec).{ts,tsx,js,jsx}'],
8
+
9
+ // Ignore build artifacts and type declarations
10
+ testPathIgnorePatterns: ['/dist/', '\\.d\\.ts$'],
11
+ modulePathIgnorePatterns: ['<rootDir>/dist/'],
12
+ watchPathIgnorePatterns: ['/dist/'],
13
+
14
+ moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
15
+ };
@@ -0,0 +1,8 @@
1
+ # launchql-faker extension
2
+ comment = 'launchql-faker extension'
3
+ default_version = '0.4.6'
4
+ module_pathname = '$libdir/launchql-faker'
5
+ requires = 'citext,pgcrypto,plpgsql,uuid-ossp,launchql-types,launchql-verify'
6
+ relocatable = false
7
+ superuser = false
8
+
package/launchql.plan ADDED
@@ -0,0 +1,10 @@
1
+ %syntax-version=1.0.0
2
+ %project=launchql-faker
3
+ %uri=launchql-faker
4
+
5
+ schemas/faker/schema [launchql-types:schemas/public/domains/url] 2017-08-11T08:11:51Z skitch <skitch@5b0c196eeb62> # add schemas/faker/schema
6
+ schemas/faker/tables/dictionary/table [schemas/faker/schema] 2017-08-11T08:11:51Z skitch <skitch@5b0c196eeb62> # add schemas/faker/tables/dictionary/table
7
+ schemas/faker/procedures/utils [schemas/faker/schema schemas/faker/tables/dictionary/table] 2017-08-11T08:11:51Z skitch <skitch@5b0c196eeb62> # add schemas/faker/procedures/utils
8
+ schemas/faker/tables/cities/table [schemas/faker/schema] 2017-08-11T08:11:51Z skitch <skitch@5b0c196eeb62> # add schemas/faker/tables/cities/table
9
+ schemas/faker/tables/cities/fixtures/1602987351008_fixture [schemas/faker/schema schemas/faker/tables/cities/table] 2017-08-11T08:11:51Z skitch <skitch@5b0c196eeb62> # add schemas/faker/tables/cities/fixtures/1602987351008_fixture
10
+ schemas/faker/tables/dictionary/fixtures/1602969089665_fixture [schemas/faker/schema schemas/faker/tables/dictionary/table] 2017-08-11T08:11:51Z skitch <skitch@5b0c196eeb62> # add schemas/faker/tables/dictionary/fixtures/1602969089665_fixture
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@pgpm/faker",
3
+ "version": "0.4.0",
4
+ "description": "Fake data generation utilities for testing and development",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "scripts": {
9
+ "bundle": "lql package",
10
+ "test": "jest",
11
+ "test:watch": "jest --watch"
12
+ },
13
+ "dependencies": {
14
+ "@pgpm/types": "0.4.0",
15
+ "@pgpm/verify": "0.4.0"
16
+ },
17
+ "devDependencies": {
18
+ "@launchql/cli": "^4.9.0"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/launchql/extensions"
23
+ },
24
+ "homepage": "https://github.com/launchql/extensions",
25
+ "bugs": {
26
+ "url": "https://github.com/launchql/extensions/issues"
27
+ },
28
+ "gitHead": "cc9f52a335caa6e21ee7751b04b77c84ce6cb809"
29
+ }
@@ -0,0 +1,51 @@
1
+ -- Revert schemas/faker/procedures/utils from pg
2
+
3
+ BEGIN;
4
+
5
+ DROP FUNCTION faker.attachment;
6
+ DROP FUNCTION faker.ip;
7
+ DROP FUNCTION faker.upload;
8
+ DROP FUNCTION faker.url;
9
+ DROP FUNCTION faker.file;
10
+ DROP FUNCTION faker.profilepic(gender text);
11
+ DROP FUNCTION faker.profilepic();
12
+ DROP FUNCTION faker.image;
13
+ DROP FUNCTION faker.image_mime;
14
+ DROP FUNCTION faker.ext;
15
+ DROP FUNCTION faker.mime;
16
+ DROP FUNCTION faker.timestamptz;
17
+ DROP FUNCTION faker.boolean;
18
+ DROP FUNCTION faker.interval(min int, max int);
19
+ DROP FUNCTION faker.interval();
20
+ DROP FUNCTION faker.birthdate;
21
+ DROP FUNCTION faker.date;
22
+ DROP FUNCTION faker.integer;
23
+ DROP FUNCTION faker.float;
24
+ DROP FUNCTION faker.time_unit;
25
+ DROP FUNCTION faker.hostname;
26
+ DROP FUNCTION faker.password;
27
+ DROP FUNCTION faker.token;
28
+ DROP FUNCTION faker.uuid;
29
+ DROP FUNCTION faker.email;
30
+ DROP FUNCTION faker.paragraph;
31
+ DROP FUNCTION faker.sentence;
32
+ DROP FUNCTION faker.tags;
33
+ DROP FUNCTION faker.address;
34
+ DROP FUNCTION faker.state;
35
+ DROP FUNCTION faker.street;
36
+ DROP FUNCTION faker.phone;
37
+ DROP FUNCTION faker.lnglat(city text);
38
+ DROP FUNCTION faker.lnglat(x1 float, y1 float, x2 float, y2 float);
39
+ DROP FUNCTION faker.zip;
40
+ DROP FUNCTION faker.city;
41
+ DROP FUNCTION faker.business;
42
+ DROP FUNCTION faker.fullname;
43
+ DROP FUNCTION faker.surname;
44
+ DROP FUNCTION faker.name;
45
+ DROP FUNCTION faker.username;
46
+ DROP FUNCTION faker.gender;
47
+ DROP FUNCTION faker.word(wordtypes text[]);
48
+ DROP FUNCTION faker.word(wordtype text);
49
+ DROP FUNCTION faker.word_type;
50
+
51
+ COMMIT;
@@ -0,0 +1,7 @@
1
+ -- Revert schemas/faker/schema from pg
2
+
3
+ BEGIN;
4
+
5
+ DROP SCHEMA faker;
6
+
7
+ COMMIT;
@@ -0,0 +1,5 @@
1
+ -- Revert schemas/faker/tables/cities/fixtures/1602987351008_fixture from pg
2
+
3
+ BEGIN;
4
+
5
+ COMMIT;
@@ -0,0 +1,7 @@
1
+ -- Revert schemas/faker/tables/cities/table from pg
2
+
3
+ BEGIN;
4
+
5
+ DROP TABLE faker.cities;
6
+
7
+ COMMIT;
@@ -0,0 +1,5 @@
1
+ -- Revert schemas/faker/tables/dictionary/fixtures/1602969089665_fixture from pg
2
+
3
+ BEGIN;
4
+
5
+ COMMIT;
@@ -0,0 +1,7 @@
1
+ -- Revert schemas/faker/tables/dictionary/table from pg
2
+
3
+ BEGIN;
4
+
5
+ DROP TABLE faker.dictionary;
6
+
7
+ COMMIT;