{"id":9800,"date":"2023-10-10T13:03:44","date_gmt":"2023-10-10T11:03:44","guid":{"rendered":"https:\/\/smartdatamodels.org\/?page_id=9800"},"modified":"2023-10-17T12:23:39","modified_gmt":"2023-10-17T10:23:39","slug":"sql-service","status":"publish","type":"page","link":"https:\/\/smartdatamodels.org\/index.php\/sql-service\/","title":{"rendered":"SQL service"},"content":{"rendered":"<h2>PostgreSQL schema generator<\/h2>\n<p><strong> Objective:<\/strong> This service generates a PostgreSQL schema script from your Smart Data Model model.yaml representation e.g to create a table, create type, etc.<\/p>\n<p><b>Example:\u00a0<\/b><\/p>\n<p>Data model (raw version): <a href=\"https:\/\/raw.githubusercontent.com\/smart-data-models\/dataModel.Weather\/master\/WeatherObserved\/model.yaml\">model.yaml<\/a><\/p>\n<p>Corresponding SQL schema: <a href=\"https:\/\/github.com\/smart-data-models\/dataModel.Weather\/blob\/7b88f13bf613ade8ddc3226d7a6f566051201500\/WeatherObserved\/schema.sql\">schema.sql<\/a><\/p>\n<p><strong>Test the service:\u00a0<\/strong><\/p>\n\n<div class=\"wpcf7 no-js\" id=\"wpcf7-f9803-o1\" lang=\"en-US\" dir=\"ltr\" data-wpcf7-id=\"9803\">\n<div class=\"screen-reader-response\"><p role=\"status\" aria-live=\"polite\" aria-atomic=\"true\"><\/p> <ul><\/ul><\/div>\n<form action=\"\/index.php\/wp-json\/wp\/v2\/pages\/9800#wpcf7-f9803-o1\" method=\"post\" class=\"wpcf7-form init\" aria-label=\"Contact form\" novalidate=\"novalidate\" data-status=\"init\">\n<fieldset class=\"hidden-fields-container\"><input type=\"hidden\" name=\"_wpcf7\" value=\"9803\" \/><input type=\"hidden\" name=\"_wpcf7_version\" value=\"6.1.5\" \/><input type=\"hidden\" name=\"_wpcf7_locale\" value=\"en_US\" \/><input type=\"hidden\" name=\"_wpcf7_unit_tag\" value=\"wpcf7-f9803-o1\" \/><input type=\"hidden\" name=\"_wpcf7_container_post\" value=\"0\" \/><input type=\"hidden\" name=\"_wpcf7_posted_data_hash\" value=\"\" \/><input type=\"hidden\" name=\"_wpcf7cf_hidden_group_fields\" value=\"[]\" \/><input type=\"hidden\" name=\"_wpcf7cf_hidden_groups\" value=\"[]\" \/><input type=\"hidden\" name=\"_wpcf7cf_visible_groups\" value=\"[]\" \/><input type=\"hidden\" name=\"_wpcf7cf_repeaters\" value=\"[]\" \/><input type=\"hidden\" name=\"_wpcf7cf_steps\" value=\"{}\" \/><input type=\"hidden\" name=\"_wpcf7cf_options\" value=\"{&quot;form_id&quot;:9803,&quot;conditions&quot;:[],&quot;settings&quot;:{&quot;animation&quot;:&quot;yes&quot;,&quot;animation_intime&quot;:&quot;200&quot;,&quot;animation_outtime&quot;:&quot;200&quot;,&quot;conditions_ui&quot;:&quot;normal&quot;,&quot;notice_dismissed&quot;:&quot;true&quot;,&quot;notice_dismissed_rollback-cf7-5.9.4&quot;:true,&quot;notice_dismissed_rollback-cf7-5.9.5&quot;:true,&quot;notice_dismissed_rollback-cf7-6.1.4&quot;:true}}\" \/><input type=\"hidden\" name=\"redirect_nonce\" value=\"a6e64f3f9f\" \/><input type=\"hidden\" name=\"wpcf7cfpdf_hidden_name\" value=\"document-pdf\" \/><input type=\"hidden\" name=\"wpcf7cfpdf_hidden_reference\" value=\"e65b67bf\" \/><input type=\"hidden\" name=\"wpcf7cfpdf_hidden_date\" value=\"04052026\" \/><input type=\"hidden\" name=\"_wpcf7_recaptcha_response\" value=\"\" \/>\n<\/fieldset>\n<style>\n.wpcf7-form {\n background-color: #ffffff;\n border: 3px solid #000000;\n box-shadow: 0px 9px 21px 6px rgba(0,0,0,0.5);\n padding: 2em;\n overflow: none !important;\n}\n\n.wpcf7-form .wpcf7-text,\n.wpcf7-form .wpcf7-textarea {\n background-color: transparent;\n border-bottom: 1px solid #001;\n border-top: 1px solid transparent;\n border-left: 1px solid transparent;\n border-right: 1px solid transparent;\n margin-bottom: 40px;\n outline: none;\n transition: 0.4s border;\n}\n\n.wpcf7-form .wpcf7-text:focus,\n.wpcf7-form .wpcf7-textarea:focus,\n.wpcf7-form .wpcf7-text:hover,\n.wpcf7-form .wpcf7-textarea:hover {\n border: 1px dashed #001;\n}\n<\/style>\n<div class=\"divTable\" style=\"border: 0px solid #000;\">\n\t<div class=\"divTableBody\">\n\t\t<div class=\"divTableRow\">\n\t\t\t<div class=\"divTableCell\">\n\t\t\t\t<p>This form takes as input a model.yaml file and generates the SQL schema corresponding to it\n\t\t\t\t<\/p>\n\t\t\t\t<p><label> URL of the raw model.yaml (URL of the raw version on GitHub, such as <a href=\"https:\/\/raw.githubusercontent.com\/smart-data-models\/dataModel.Weather\/master\/WeatherAlert\/model.yaml\" target=\"_blank\">https:\/\/raw.githubusercontent.com\/smart-data-models\/dataModel.Weather\/master\/WeatherAlert\/model.yaml<\/a>)<\/label><br \/>\n<span class=\"wpcf7-form-control-wrap\" data-name=\"modelYamlUrl\"><input size=\"40\" maxlength=\"200\" class=\"wpcf7-form-control wpcf7-text wpcf7-validates-as-required\" aria-required=\"true\" aria-invalid=\"false\" value=\"\" type=\"text\" name=\"modelYamlUrl\" \/><\/span>\n\t\t\t\t<\/p>\n\t\t\t<\/div>\n\t\t\t<div class=\"divTableCell\">\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<div class=\"divTableRow\">\n\t\t\t<div class=\"divTableCell\">\n\t\t\t\t<p><label> E-MAIL (Your E-mail is used for providing feedback on your submission).<\/label><br \/>\n<span class=\"wpcf7-form-control-wrap\" data-name=\"email\"><input size=\"40\" maxlength=\"200\" class=\"wpcf7-form-control wpcf7-email wpcf7-validates-as-required wpcf7-text wpcf7-validates-as-email\" aria-required=\"true\" aria-invalid=\"false\" value=\"\" type=\"email\" name=\"email\" \/><\/span>\n\t\t\t\t<\/p>\n\t\t\t<\/div>\n\t\t\t<div class=\"divTableCell\">\n\t\t\t<\/div>\n\t\t<\/div>\n\t<\/div>\n<\/div>\n<p><span class=\"wpcf7-form-control-wrap wpgdprc\"><span class=\"wpcf7-form-control wpcf7-wpgdprc wpcf7-validates-as-required\"><span class=\"wpcf7-list-item\"><input type=\"checkbox\" name=\"wpgdprc\" value=\"1\" aria-required=\"true\" aria-invalid=\"false\" \/><span class=\"wpcf7-list-item-label\">By using this form you agree with the storage and handling of your data by this website.<\/span><\/span><\/span>    <\/span>\n<\/p>\n<p><input class=\"wpcf7-form-control wpcf7-submit has-spinner\" type=\"submit\" value=\"Submit\" \/>\n<\/p>\n<p>After clicking, a message confirming the submission will appear. It will take an instant to redirect to the results.\n<\/p><p style=\"display: none !important;\" class=\"akismet-fields-container\" data-prefix=\"_wpcf7_ak_\"><label>&#916;<textarea name=\"_wpcf7_ak_hp_textarea\" cols=\"45\" rows=\"8\" maxlength=\"100\"><\/textarea><\/label><input type=\"hidden\" id=\"ak_js_1\" name=\"_wpcf7_ak_js\" value=\"70\"\/><script>document.getElementById( \"ak_js_1\" ).setAttribute( \"value\", ( new Date() ).getTime() );<\/script><\/p><div class=\"wpcf7-response-output\" aria-hidden=\"true\"><\/div>\n<\/form>\n<\/div>\n\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PostgreSQL schema generator Objective: This service generates a PostgreSQL schema script from your Smart Data Model model.yaml representation e.g to create a table, create type, etc. Example:\u00a0 Data model (raw version): model.yaml Corresponding SQL schema: schema.sql Test the service:\u00a0 &nbsp; <a class=\"continue-reading-link\" href=\"https:\/\/smartdatamodels.org\/index.php\/sql-service\/\">More&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-9800","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":9788,"url":"https:\/\/smartdatamodels.org\/index.php\/sql-schema-generator\/","url_meta":{"origin":9800,"position":0},"title":"SQL schema generator","author":"maestro","date":"04\/10\/2023","format":false,"excerpt":"","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9911,"url":"https:\/\/smartdatamodels.org\/index.php\/sql-result\/","url_meta":{"origin":9800,"position":1},"title":"SQL result","author":"maestro","date":"10\/10\/2023","format":false,"excerpt":"The SQL schema for your data model is like follows: \u00a0","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10260,"url":"https:\/\/smartdatamodels.org\/index.php\/metadata-of-the-data-models-catalog-available\/","url_meta":{"origin":9800,"position":2},"title":"Metadata of the data models catalog available","author":"maestro","date":"01\/02\/2024","format":false,"excerpt":"In this link you have all metadata of the catalogue available as a json file. It includes: subject data model version of the data model modelTags title url to $id of the schema description of the data model required attributes yamlUrl link to the yaml version of the schema jsonSchemaUrl\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4017,"url":"https:\/\/smartdatamodels.org\/index.php\/create-your-json-schema-from-a-csv-payload\/","url_meta":{"origin":9800,"position":3},"title":"Create your json schema from a csv payload","author":"maestro","date":"30\/03\/2022","format":false,"excerpt":"","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3847,"url":"https:\/\/smartdatamodels.org\/index.php\/generate-you-schema-out-of-your-payload\/","url_meta":{"origin":9800,"position":4},"title":"Generate you schema out of your payload","author":"maestro","date":"08\/03\/2022","format":false,"excerpt":"source code of this service if you want to improve it.","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/smartdatamodels.org\/wp-content\/uploads\/2022\/11\/smart_data_models_icon.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1221,"url":"https:\/\/smartdatamodels.org\/index.php\/procedure-for-adding-new-data-model\/","url_meta":{"origin":9800,"position":5},"title":"Procedure for adding new data model","author":"maestro","date":"02\/01\/2021","format":false,"excerpt":"Supposedly the data model meets the contribution manual requirements these steps should be taken If there is to create new subject warn these points: Rename 'main' branch to 'master' Check that the page for the repo is published. It could take to github up to 5 minutes since you enable\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/pages\/9800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/comments?post=9800"}],"version-history":[{"count":6,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/pages\/9800\/revisions"}],"predecessor-version":[{"id":9992,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/pages\/9800\/revisions\/9992"}],"wp:attachment":[{"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/media?parent=9800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}