{"id":14974060,"url":"https://github.com/juliendelplanque/postgresqlparser","last_synced_at":"2025-10-27T05:31:30.748Z","repository":{"id":53713457,"uuid":"105666719","full_name":"juliendelplanque/PostgreSQLParser","owner":"juliendelplanque","description":"A parser for PostgreSQL written in Pharo using PetitParser.","archived":false,"fork":false,"pushed_at":"2021-03-18T17:37:01.000Z","size":1332,"stargazers_count":7,"open_issues_count":20,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-01T02:41:26.138Z","etag":null,"topics":["parser","petitparser","pharo","plpgsql","postgresql"],"latest_commit_sha":null,"homepage":null,"language":"Smalltalk","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juliendelplanque.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-03T15:13:11.000Z","updated_at":"2024-03-21T01:02:57.000Z","dependencies_parsed_at":"2022-09-23T12:51:13.705Z","dependency_job_id":null,"html_url":"https://github.com/juliendelplanque/PostgreSQLParser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendelplanque%2FPostgreSQLParser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendelplanque%2FPostgreSQLParser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendelplanque%2FPostgreSQLParser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendelplanque%2FPostgreSQLParser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juliendelplanque","download_url":"https://codeload.github.com/juliendelplanque/PostgreSQLParser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238445840,"owners_count":19473821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["parser","petitparser","pharo","plpgsql","postgresql"],"created_at":"2024-09-24T13:49:53.855Z","updated_at":"2025-10-27T05:31:30.186Z","avatar_url":"https://github.com/juliendelplanque.png","language":"Smalltalk","readme":"# PostgreSQLParser [![Build Status](https://travis-ci.com/juliendelplanque/PostgreSQLParser.svg?branch=master)](https://travis-ci.com/juliendelplanque/PostgreSQLParser)\nA parser for PostgreSQL written in Pharo using PetitParser.\n\nFor now, the focus is made on PL/pgSQL source code.\n\n- [Install](#install)\n\t- [Groups](#groups)\n\t- [Use it as a dependency](#use-it-as-a-dependency)\n- [Usage](#usage)\n\n\n## Install\n```\nMetacello new\n\tbaseline: 'PostgreSQLParser';\n\trepository: 'github://juliendelplanque/PostgreSQLParser/src';\n\tload\n```\n\n### Groups\nYou can use the groups defined in the baseline to install only what you need. The following groups are available:\n\n- `parser` : Only the tokenizer and the grammar.\n- `parser-tests` : `parser` and its unit tests.\n- `ast` : Only the Abstract Syntactic Tree model.\n- `ast-builder` : `ast` + the object that builds the AST from the source code (also requires `parser`).\n- `ast-builder-tests` : `ast-builder` + its unit tests.\n- `visitors` : `ast` + default visitors of the AST.\n- `core` : `parser` + `ast` + `ast-builder`.\n- `core-tests` : `core` + all unit tests associated.\n- `future` : Experimental code of this project, do not use this in production.\n- `dev` : Everything you need to help in this project development loads `future` group as well.\n\nLet's say you only need the `ast` group, the following code will load this specific group:\n```\nMetacello new\n\tbaseline: 'PostgreSQLParser';\n\trepository: 'github://juliendelplanque/PostgreSQLParser/src';\n\tload: 'ast'\n```\n\n### Use it as a dependency\nTo use this project as a dependency, add the following code in your baseline:\n\n```\n[...]\nspec baseline: 'PostgreSQLParser' with: [ \n\tspec\n\t\trepository: 'github://juliendelplanque/PostgreSQLParser/src' ]\n[...]\n```\n\n# Usage\nThe complexity of the parsing process is hidden (for users) behind a [facade](https://en.wikipedia.org/wiki/Facade_pattern): `PostgreSQLParser` class. The class-side methods provide a simple API to parse SQL code and get an AST as return.\n\nFor example:\n\n```\nast := PostgreSQLParser parseSelectQuery: 'SELECT person.id, person.name, person.city_id \nFROM person, city\nWHERE person.city_id = city.id\nLIMIT 10'. \"Mind that there is not trailing ';' because this is part of statement's grammar not query grammar.\"\n\n\"... process the AST... \"\n```\n\nThere other methods work similarly:\n\n- `PostgreSQLParser class\u003e\u003e#parseUpdateQuery:`\n- `PostgreSQLParser class\u003e\u003e#parseCRUDQuery:`\n- `PostgreSQLParser class\u003e\u003e#parseDeleteQuery:`\n- `PostgreSQLParser class\u003e\u003e#parseInsertQuery:`\n- `PostgreSQLParser class\u003e\u003e#parseSelectQuery:`\n- `PostgreSQLParser class\u003e\u003e#parseStoredProcedureBody:`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliendelplanque%2Fpostgresqlparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliendelplanque%2Fpostgresqlparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliendelplanque%2Fpostgresqlparser/lists"}