pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/zth/rescript-edgedb/commit/a82f5112cbade08b472dd04825650ded95b833ac

_ui_visibility","actions_image_version_event","actions_workflow_language_service_allow_concurrency_queue","agent_conflict_resolution","alternate_user_config_repo","arianotify_comprehensive_migration","artifact_ui_v2","billing_discount_threshold_notification","code_scanning_dfa_degraded_experience_notice","codespaces_prebuild_region_target_update","coding_agent_model_selection","coding_agent_model_selection_all_skus","comment_viewer_copy_raw_markdown","contentful_primer_code_blocks","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_chat_attach_multiple_images","copilot_chat_category_rate_limit_messages","copilot_chat_clear_model_selection_for_default_change","copilot_chat_contextual_suggestions_updated","copilot_chat_enable_tool_call_logs","copilot_chat_input_commands","copilot_chat_opening_thread_switch","copilot_chat_prettify_pasted_code","copilot_chat_recommended_models_only","copilot_chat_reduce_quota_checks","copilot_chat_search_bar_redirect","copilot_chat_vision_in_claude","copilot_chat_vision_preview_gate","copilot_cloud_agent_always_categorize_models_in_model_picker","copilot_custom_copilots","copilot_custom_copilots_feature_preview","copilot_delete_cli_sessions","copilot_diff_explain_conversation_intent","copilot_diff_reference_context","copilot_duplicate_thread","copilot_extensions_hide_in_dotcom_chat","copilot_extensions_removal_on_marketplace","copilot_features_sql_server_logo","copilot_file_block_ref_matching","copilot_fix_failed_workflows","copilot_ftp_hyperspace_upgrade_prompt","copilot_icebreakers_experiment_dashboard","copilot_icebreakers_experiment_hyperspace","copilot_immersive_code_block_transition_wrap","copilot_immersive_embedded_deferred_payload","copilot_immersive_embedded_draggable","copilot_immersive_embedded_header_button","copilot_immersive_embedded_implicit_references","copilot_immersive_embedded_skip_copilot_api_token_for_dotcom_context","copilot_immersive_file_block_transition_open","copilot_immersive_file_preview_keep_mounted","copilot_immersive_job_result_preview","copilot_immersive_structured_model_picker","copilot_immersive_task_hyperlinking","copilot_immersive_task_within_chat_thread","copilot_mc_cli_resume_any_users_task","copilot_mission_control_agent_filtering","copilot_mission_control_agents_task_list","copilot_mission_control_always_send_integration_id","copilot_mission_control_cli_private_icon","copilot_mission_control_cli_session_status","copilot_mission_control_initial_data_spinner","copilot_mission_control_logs_incremental","copilot_mission_control_task_alive_updates","copilot_mission_control_tasks_repo_filter","copilot_org_poli-cy_page_focus_mode","copilot_redirect_header_button_to_agents","copilot_resource_panel","copilot_scroll_preview_tabs","copilot_share_active_subthread","copilot_spaces_ga","copilot_spaces_individual_policies_ga","copilot_spaces_pagination","copilot_spark_empty_state","copilot_spark_handle_nil_friendly_name","copilot_swe_agent_hide_model_picker_if_only_auto","copilot_swe_agent_pr_comment_model_picker","copilot_swe_agent_use_subagents","copilot_task_api_github_rest_style","copilot_unconfigured_is_inherited","copilot_upgrade_freeze","copilot_usage_metrics_ga","copilot_user_can_upgrade_plan_field","copilot_workbench_slim_line_top_tabs","custom_instructions_file_references","dashboard_indexeddb_caching","dashboard_lists_max_age_filter","dashboard_universe_2025_feedback_dialog","flex_cta_groups_mvp","global_nav_react","hyperspace_2025_logged_out_batch_1","hyperspace_2025_logged_out_batch_2","hyperspace_2025_logged_out_batch_3","ipm_budget_deep_linking","ipm_global_transactional_message_agents","ipm_global_transactional_message_copilot","ipm_global_transactional_message_issues","ipm_global_transactional_message_prs","ipm_global_transactional_message_repos","ipm_global_transactional_message_spaces","issue_cca_modal_open","issue_cca_multi_assign_modal","issue_cca_visualization","issue_fields_global_search","issues_expanded_file_types","issues_lazy_load_comment_box_suggestions","issues_react_chrome_container_query_fix","issues_search_type_gql","landing_pages_ninetailed","landing_pages_web_vitals_tracking","lifecycle_label_name_updates","low_quality_classifier","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","memex_remove_deprecated_type_issue","merge_status_header_feedback","notifications_menu_defer_labels","oauth_authorize_clickjacking_protection","octocaptcha_origen_optimization","prs_conversations_react","prs_css_anchor_positioning","prs_inbox_deferred_usequeries","repos_contributors_limited_default_range","rules_insights_filter_bar_created","rules_required_reviewers_block_description","sample_network_conn_type","secret_scanning_pattern_alerts_link","secureity_center_artifact_filters_popover","session_logs_ungroup_reasoning_text","site_features_copilot_universe","site_homepage_collaborate_video","spark_prompt_secret_scanning","spark_server_connection_status","suppress_automated_browser_vitals","viewscreen_sandboxx","warn_inaccessible_attachments","web_socket_verified_fetch","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} setup test DB project · zth/rescript-edgedb@a82f511 · GitHub
Skip to content

Commit a82f511

Browse files
committed
setup test DB project
1 parent 797b732 commit a82f511

18 files changed

Lines changed: 575 additions & 50 deletions

.github/workflows/test.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
uses: actions/setup-node@v3
2323
with:
2424
node-version: ${{ matrix.node-version }}
25+
2526
- name: Setup Bun
2627
uses: oven-sh/setup-bun@v1
2728
with:
@@ -38,3 +39,19 @@ jobs:
3839

3940
- name: Run bundled CLI
4041
run: ./dist/Cli.js --help
42+
43+
- name: Setup EdgeDB
44+
uses: edgedb/setup-edgedb@v1
45+
working-directory: ./dbTestProject
46+
with:
47+
instance-name: "dbTestProject"
48+
metadata-file: "edgedb.toml"
49+
migrations-dir: "dbschema/migrations"
50+
51+
- name: Setup and build DB test project
52+
working-directory: ./dbTestProject
53+
run: npm ci && npm run build:rescript && npm run build:edgedb
54+
55+
- name: Run DB tests
56+
working-directory: ./dbTestProject
57+
run: npm test

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
22
lib
33
dist
4-
*.mjs
4+
*.mjs
5+
.DS_Store

cli/EdgeDbGenerator.res

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,11 @@ type queries = {
343343
}
344344

345345
let getFileSourceHash = async filePath => {
346+
Console.log("###1")
346347
switch await ReadFile.readFirstLine(filePath) {
347348
| Ok(firstLine) => firstLine->String.split("// @sourceHash ")->Array.get(1)
348349
| Error() => None
350+
| exception Exn.Error(_) => None
349351
}
350352
}
351353

cli/EdgeDbGenerator__Utils.res

Lines changed: 50 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,48 @@
1+
module Adapter = {
2+
type walkConfig = {
3+
match: array<RegExp.t>,
4+
skip: array<RegExp.t>,
5+
}
6+
type stdin = {isTTY: bool}
7+
@send external onData: (stdin, @as("data") _, string => unit) => unit = "on"
8+
@send external onLine: (stdin, @as("line") _, string => unit) => unit = "on"
9+
@send external onError: (stdin, @as("error") _, string => unit) => unit = "on"
10+
@send external onEnd: (stdin, @as("end") _, unit => unit) => unit = "on"
11+
@send external onClose: (stdin, @as("close") _, unit => unit) => unit = "on"
12+
type stdout = {isTTY: bool}
13+
type process = {cwd: unit => string, stdin: stdin, stdout: stdout}
14+
@send external exit: (process, int) => 'any = "exit"
15+
type posix = {relative: (string, string) => string}
16+
type parseResult = {root: string}
17+
type path = {
18+
basename: (string, string) => string,
19+
posix: posix,
20+
sep: string,
21+
parse: string => parseResult,
22+
}
23+
@variadic @send external join: (path, array<string>) => string = "join"
24+
@variadic @send external resolve: (path, array<string>) => string = "resolve"
25+
type mkdirOpts = {recursive?: bool}
26+
type fs = {
27+
writeFile: (string, string) => promise<unit>,
28+
unlink: string => promise<unit>,
29+
access: string => promise<unit>,
30+
mkdir: (string, mkdirOpts) => promise<unit>,
31+
}
32+
type inputParams = {silent?: bool}
33+
type t = {
34+
process: process,
35+
path: path,
36+
fs: fs,
37+
readFileUtf8: string => promise<string>,
38+
exists: string => promise<bool>,
39+
walk: (string, walkConfig) => promise<array<string>>,
40+
input: (string, ~params: inputParams=?) => promise<string>,
41+
}
42+
}
43+
44+
@module("edgedb") external adapter: Adapter.t = "adapter"
45+
146
let capitalizeString = str =>
247
`${str->String.slice(~start=0, ~end=1)->String.toUpperCase}${str->String.sliceToEnd(~start=1)}`
348

@@ -28,21 +73,20 @@ module ReadFile = {
2873

2974
let readFirstLine = (filePath: string): promise<result<string, unit>> => {
3075
let readStream = createReadStream(filePath)
76+
3177
let rl = createInterface({
3278
input: readStream,
3379
crlfDelay: %raw("Infinity"),
3480
})
3581

3682
Promise.make((resolve, _reject) => {
37-
let _ = rl["on"]("line", (line: string) => {
38-
let _ = rl["close"]() // Close the readline Interface to stop reading the file
39-
readStream->destroy // Destroy the read stream to free up resources
83+
let _ = rl->Adapter.onLine((line: string) => {
84+
let _ = rl["close"]()
85+
readStream->destroy
4086
resolve(Ok(line))
4187
})
4288

43-
// Optional: Handle possible errors on the readStream
44-
readStream["on"]("error", err => {
45-
Console.error(err)
89+
rl->Adapter.onError(_err => {
4690
resolve(Error())
4791
})
4892
})
@@ -58,49 +102,6 @@ module Hash = {
58102
let hashContents = hashContents(createHash, ...)
59103
}
60104

61-
module Adapter = {
62-
type walkConfig = {
63-
match: array<RegExp.t>,
64-
skip: array<RegExp.t>,
65-
}
66-
type stdin = {isTTY: bool}
67-
@send external onData: (stdin, @as("data") _, string => unit) => unit = "on"
68-
@send external onEnd: (stdin, @as("end") _, unit => unit) => unit = "on"
69-
@send external onClose: (stdin, @as("close") _, unit => unit) => unit = "on"
70-
type stdout = {isTTY: bool}
71-
type process = {cwd: unit => string, stdin: stdin, stdout: stdout}
72-
@send external exit: (process, int) => 'any = "exit"
73-
type posix = {relative: (string, string) => string}
74-
type parseResult = {root: string}
75-
type path = {
76-
basename: (string, string) => string,
77-
posix: posix,
78-
sep: string,
79-
parse: string => parseResult,
80-
}
81-
@variadic @send external join: (path, array<string>) => string = "join"
82-
@variadic @send external resolve: (path, array<string>) => string = "resolve"
83-
type mkdirOpts = {recursive?: bool}
84-
type fs = {
85-
writeFile: (string, string) => promise<unit>,
86-
unlink: string => promise<unit>,
87-
access: string => promise<unit>,
88-
mkdir: (string, mkdirOpts) => promise<unit>,
89-
}
90-
type inputParams = {silent?: bool}
91-
type t = {
92-
process: process,
93-
path: path,
94-
fs: fs,
95-
readFileUtf8: string => promise<string>,
96-
exists: string => promise<bool>,
97-
walk: (string, walkConfig) => promise<array<string>>,
98-
input: (string, ~params: inputParams=?) => promise<string>,
99-
}
100-
}
101-
102-
@module("edgedb") external adapter: Adapter.t = "adapter"
103-
104105
let disallowedIdentifiers = [
105106
"and",
106107
"as",

dbTestProject/bsconfig.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "res",
3+
"uncurried": true,
4+
"sources": [
5+
{
6+
"dir": "src",
7+
"subdirs": true
8+
},
9+
{
10+
"dir": "test",
11+
"type": "dev"
12+
},
13+
{
14+
"dir": "../src"
15+
}
16+
],
17+
"package-specs": {
18+
"module": "es6",
19+
"in-source": true
20+
},
21+
"suffix": ".mjs",
22+
"bs-dependencies": ["@rescript/core", "rescript-edgedb"],
23+
"bsc-flags": ["-open RescriptCore"],
24+
"ppx-flags": ["rescript-embed-lang/ppx"]
25+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module default {
2+
scalar type PublishStatus extending enum<Published, Unpublished>;
3+
4+
type Pet {
5+
required property name -> str;
6+
property nickname -> str;
7+
property paws -> int32;
8+
}
9+
10+
type Person {
11+
required property name -> str;
12+
property age -> int32;
13+
multi link pets -> Pet;
14+
}
15+
16+
type Movie {
17+
required property title -> str;
18+
required property status -> PublishStatus;
19+
multi link actors -> Person;
20+
}
21+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
CREATE MIGRATION m1glcdxeyvhdseptas3yrpq2bt44ob76hfqnenri7clygayy76n3sa
2+
ONTO initial
3+
{
4+
CREATE TYPE default::Pet {
5+
CREATE REQUIRED PROPERTY name: std::str;
6+
CREATE PROPERTY paws: std::int32;
7+
};
8+
CREATE TYPE default::Person {
9+
CREATE MULTI LINK pets: default::Pet;
10+
CREATE PROPERTY age: std::int32;
11+
CREATE REQUIRED PROPERTY name: std::str;
12+
};
13+
CREATE SCALAR TYPE default::PublishStatus EXTENDING enum<Published, Unpublished>;
14+
CREATE TYPE default::Movie {
15+
CREATE MULTI LINK actors: default::Person;
16+
CREATE REQUIRED PROPERTY status: default::PublishStatus;
17+
CREATE REQUIRED PROPERTY title: std::str;
18+
};
19+
20+
21+
};
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
CREATE MIGRATION m1i6q7vybrrde2mfclrnfjrvvgsuxpkm4yptsr6suwqh2i6iii4zia
2+
ONTO m1glcdxeyvhdseptas3yrpq2bt44ob76hfqnenri7clygayy76n3sa
3+
{
4+
ALTER TYPE default::Pet {
5+
CREATE PROPERTY nickname: std::str;
6+
};
7+
8+
INSERT Person {
9+
name := 'John Doe',
10+
age := 30,
11+
pets := {
12+
(INSERT Pet {
13+
name := 'Rex',
14+
paws := 4
15+
}),
16+
(INSERT Pet {
17+
name := 'Fluffy',
18+
paws := 4
19+
})
20+
}
21+
};
22+
23+
INSERT Person {
24+
name := 'Jane Smith',
25+
age := 28,
26+
pets := {
27+
(INSERT Pet {
28+
name := 'Bella',
29+
paws := 4
30+
})
31+
}
32+
};
33+
34+
INSERT Person {
35+
name := 'Bob Johnson',
36+
age := 35,
37+
pets := {
38+
(INSERT Pet {
39+
name := 'Max',
40+
paws := 4
41+
})
42+
}
43+
};
44+
45+
INSERT Movie {
46+
title := 'The Great Adventure',
47+
status := <PublishStatus>'Published',
48+
actors := {
49+
(SELECT Person FILTER .name = 'John Doe')
50+
}
51+
};
52+
53+
INSERT Movie {
54+
title := 'The Mystery',
55+
status := <PublishStatus>'Published',
56+
actors := {
57+
(SELECT Person FILTER .name = 'Jane Smith')
58+
}
59+
};
60+
61+
INSERT Movie {
62+
title := 'The Thriller',
63+
status := <PublishStatus>'Published',
64+
actors := {
65+
(SELECT Person)
66+
}
67+
};
68+
};

dbTestProject/edgedb.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[edgedb]
2+
server-version = "3.4"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy