Skip to content

Commit

Permalink
fix: examples with custom type mapping
Browse files Browse the repository at this point in the history
the default file is `types.ts`
  • Loading branch information
ferm10n committed Jun 13, 2024
1 parent dfadb84 commit 4a823fe
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/common-types/plv8ify-dist/hello.plv8.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DROP FUNCTION IF EXISTS hello(test JSONB);
CREATE OR REPLACE FUNCTION hello(test JSONB) RETURNS JSONB AS $plv8ify$
DROP FUNCTION IF EXISTS hello(test test_type[]);
CREATE OR REPLACE FUNCTION hello(test test_type[]) RETURNS test_type AS $plv8ify$
// examples/common-types/input.ts
function hello(test) {
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
typeMap = {
number: 'float8',
string: 'text',
Expand Down
4 changes: 2 additions & 2 deletions examples/hello-custom-type/plv8ify-dist/hello.plv8.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DROP FUNCTION IF EXISTS hello(test JSONB);
CREATE OR REPLACE FUNCTION hello(test JSONB) RETURNS JSONB AS $plv8ify$
DROP FUNCTION IF EXISTS hello(test test_type[]);
CREATE OR REPLACE FUNCTION hello(test test_type[]) RETURNS test_type AS $plv8ify$
// examples/hello-custom-type/input.ts
function hello(test) {
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
typeMap = {
number: 'float8',
string: 'text',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"example:react-js": "bun run --bun src/index.ts generate --input-file examples/react-js/input.tsx --output-folder examples/react-js/plv8ify-dist",
"example:trackfootball": "bun run --bun src/index.ts generate --input-file examples/trackfootball/input.tsx --output-folder examples/trackfootball/plv8ify-dist",
"example:object-hash": "bun run --bun src/index.ts generate --input-file examples/object-hash/input.ts --output-folder examples/object-hash/plv8ify-dist",
"example:common-types": "bun run --bun src/index.ts generate --input-file examples/common-types/input.ts --output-folder examples/common-types/plv8ify-dist",
"example:hello-custom-type": "bun run --bun src/index.ts generate --input-file examples/hello-custom-type/input.ts --output-folder examples/hello-custom-type/plv8ify-dist",
"example:common-types": "bun run --bun src/index.ts generate --input-file examples/common-types/input.ts --types-config-file examples/common-types/types.ts --output-folder examples/common-types/plv8ify-dist",
"example:hello-custom-type": "bun run --bun src/index.ts generate --input-file examples/hello-custom-type/input.ts --types-config-file examples/hello-custom-type/types.ts --output-folder examples/hello-custom-type/plv8ify-dist",
"example:trigger": "bun run --bun src/index.ts generate --input-file examples/trigger/input.ts --output-folder examples/trigger/plv8ify-dist",
"examples": "bun example:hello; bun example:hello-start_proc; bun example:hello-bundle; bun example:turf-js; bun example:turf-js-distance; bun example:mathjs; bun example:react-js; bun example:object-hash; bun example:turf-js-distance; bun example:common-types; bun example:hello-custom-type; bun example:trigger"
}
Expand Down

0 comments on commit 4a823fe

Please sign in to comment.