{"id":15002850,"url":"https://github.com/temikfart/sql2cypher","last_synced_at":"2025-10-27T22:34:22.076Z","repository":{"id":39964181,"uuid":"456568787","full_name":"temikfart/sql2cypher","owner":"temikfart","description":"Converter from SQL to Cypher.","archived":false,"fork":false,"pushed_at":"2024-07-31T21:50:29.000Z","size":2608,"stargazers_count":12,"open_issues_count":17,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-04-09T14:40:36.101Z","etag":null,"topics":["cypher","cypher-query-language","database","mssql","mssqlserver","neo4j-database","nosql","sql","transpiler"],"latest_commit_sha":null,"homepage":"","language":"C++","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/temikfart.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-07T15:42:10.000Z","updated_at":"2024-07-28T21:03:58.000Z","dependencies_parsed_at":"2023-10-26T23:33:16.575Z","dependency_job_id":"974b416b-98b5-405a-9e20-e78a0fe5cff1","html_url":"https://github.com/temikfart/sql2cypher","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/temikfart/sql2cypher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temikfart%2Fsql2cypher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temikfart%2Fsql2cypher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temikfart%2Fsql2cypher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temikfart%2Fsql2cypher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/temikfart","download_url":"https://codeload.github.com/temikfart/sql2cypher/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temikfart%2Fsql2cypher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281355373,"owners_count":26486897,"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","status":"online","status_checked_at":"2025-10-27T02:00:05.855Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cypher","cypher-query-language","database","mssql","mssqlserver","neo4j-database","nosql","sql","transpiler"],"created_at":"2024-09-24T18:53:10.958Z","updated_at":"2025-10-27T22:34:22.060Z","avatar_url":"https://github.com/temikfart.png","language":"C++","readme":"# SCC\r\n[![Build test](https://github.com/temikfart/sql2cypher/actions/workflows/build-test.yml/badge.svg)](https://github.com/temikfart/sql2cypher/actions/workflows/build-test.yml)\r\n---\r\n### SQL to Cypher QL Converter\r\n\r\n**SCC** is a tool, which allows you to migrate data\r\nfrom the relational to the graph database.\r\nAs the relational database language was chosen Microsoft SQL\r\nfor the [Microsoft SQL Server](https://www.microsoft.com/en-gb/sql-server/sql-server-2019?rtc=2).\r\nThe MS SQL is translated to the Cypher Query Language for the \r\n[neo4j](https://neo4j.com/) graph database.\r\n\r\nIt is important to note, that **SCC** translates one file with queries per \r\ncycle. It means, that our converter doesn't analyze all queries to know more\r\nabout your database structure.\r\nEvery query from the input file is translated apart from each other.\r\nKeep this in mind when using our product.\r\nh\r\n#### Table of contents\r\n\r\n1. [Opportunities. What queries can be converted?](#Opportunities.-What-queries-can-be-converted)\r\n2. [Operating principle](#Operating-principle)\r\n3. [Installation](#Installation)\r\n   1. [Linux](#Linux)\r\n   2. [Windows](#Windows)\r\n   3. [MacOS](#MacOS)\r\n4. [Launch](#Launch)\r\n   1. [First run](#First-run)\r\n   2. [Usage](#Usage)\r\n      1. [Configuration via file](#Configuration-via-file)\r\n      2. [Configuration via console flags](#Configuration-via-console-flags)\r\n5. [How to conduct testing?](#How-to-conduct-testing)\r\n   1. [GoogleTest](#GoogleTest)\r\n   2. [Write your own unit-tests](#Write-your-own-unit-tests)\r\n6. [Documentation](#Documentation)\r\n7. [Authors](#Authors)\r\n8. [Mentors](#Mentors)\r\n\r\n\r\n## Opportunities. What queries can be converted?\r\n\r\n---\r\n\r\nAt first, we planned, that the **SCC** will convert standard DDL and DML queries.\r\nIt can be the simplest query, for example:\r\n```SQL\r\nCREATE DATABASE Zoo;\r\n```\r\nor\r\n```SQL\r\nCREATE TABLE Aviaries (\r\n    aviary_id integer,\r\n    square float,\r\n    PRIMARY KEY (aviary_id)\r\n);\r\nCREATE TABLE Zones (\r\n    zone_id integer,\r\n    PRIMARY KEY (zone_id)\r\n);\r\n```\r\nor\r\n```SQL\r\nALTER TABLE Aviaries\r\n    ADD\r\n        zone_id integer,\r\n        CONSTRAINT fk_aviaries_zones\r\n        FOREIGN KEY (aviary_id)\r\n        REFERENCES Zones (zone_id);\r\n```\r\nas DDL queries. Also, we plan to implement translation for the DML queries.\r\n\r\n## Operating principle\r\n\r\n---\r\nEvery SQL query from the input file goes through the following path:\r\n1. **Tokenization** _(Parsing on the tokens with own type, like as `word`, `operator`, etc.);_\r\n\r\nThis step is the common parsing.\r\nThe query will be introduce as tokens array at the end of tokenization.\r\n\r\n3. **Syntax Analyses** _(Analyzer introduces tokens array into AST);_\r\n\r\n**SCC** analyses tokens array via recursive descent and builds AST of the query.\r\n\r\n4. **AST handler** _(Preparing the AST to translation);_\r\n\r\n_Notice: for now, this module is not implemented._\r\n\r\nIt is an intermediate step between the Analysis and Translation.\r\nThe handler leads the AST to the correct introduction for the translation.\r\n\r\n5. **Query Assembler** _(AST analysing and translation into CQL)._\r\n\r\nTranslation.\r\nThe Assembler analyses the AST and searches for constructions for translation.\r\n\r\n## Installation\r\n\r\n---\r\nWe plan to make portable versions of the **SCC** to the all popular OS\r\nalong with accompanying installation instructions.\r\n\r\n### Linux\r\n1. Go to the Release page and download a `.deb` package;\r\n2. Go to package directory and use the following command for installation:\r\n```shell\r\n$ sudo dpkg -i package_name.deb\r\n```\r\nThis command will install the SCC on your linux.\r\n3. Use the SCC with\r\n```shell\r\n$ scc -v\r\n```\r\nYou will see the following message:\r\n```shell\r\n$ scc -v\r\n\u003c===| SCC (The SQL to CypherQL Converter) |===\u003e\r\nVersion:     0.9.0\r\nDevelopers:  Artyom Fartygin, Roman Korostinskiy\r\n```\r\n\u003e Save your time with the SCC!\r\n### Windows\r\n1. Go to the Release page and download a `.exe` package;\r\n2. Go to package directory and run installer. You will see NSIS window with\r\nwith the installation steps;\r\n3. Use the SCC with the Windows' command line:\r\n```shell\r\n$ scc -v\r\n```\r\nYou will see the following message:\r\n```shell\r\n$ scc -v\r\n\u003c===| SCC (The SQL to CypherQL Converter) |===\u003e\r\nVersion:     0.9.0\r\nDevelopers:  Artyom Fartygin, Roman Korostinskiy\r\n```\r\n\u003e Save your time with the SCC!\r\n### MacOS\r\nFor now, the SCC can't be installed in the MacOS via installer, but you can use\r\nlocal application. See [**Launch**](#Launch).\r\n\r\n## Launch\r\n\r\n---\r\n### First run\r\nOur project can be compiled via CMake. Use the following steps:\r\n1. Build the **SCC**:\r\n```shell\r\nsql2cypher/ $ cmake -S . -B build [options]\r\n```\r\nwhere options:\r\n\r\n* `-DPACKAGE=0`, if you want to use the SCC locally;\r\n* `-DPACKAGE=1`, if you want to create package;\r\n\r\nIf you will create a package, you can manually set an OS:\r\n* `-DWIN32=1` for Windows package (`.exe`). With this option you must have\r\n`MinGW` and add new option: `-G \"MinGW Makefiles\"`;\r\n* `-DUNIX=1` for Linux package (`.deb`).\r\n2. Run the converter locally:\r\n```shell\r\nsql2cypher/ $ cd build/\r\nsql2cypher/build/ $ ./SCC\r\n```\r\nYou will see the following **INFO** messages:\r\n```\r\n[INFO]  \u003cTime\u003e main.cpp: main(): 4: Starting system...\r\n[INFO]  \u003cTime\u003e main.cpp: main(): 6: System started\r\n```\r\n3. If you are creating a package for Linux or Windows you should go to `build`\r\ndirectory and run the following command:\r\n```shell\r\nsql2cypher/build/ $ make package\r\n```\r\nYou will see new file with `.deb` or `.exe` extension.\r\n\r\n### Usage\r\n\r\nThe **SCC** can be configured by the `config.ini` file in the root directory\r\nand via console flags. Let's look at these opportunities.\r\n\r\n#### Configuration via file\r\n\r\n_Notice: will be implemented in the future patches._\r\n\r\n#### Configuration via console flags\r\n```\r\nUsage:\r\n   scc --sql=file1 --cypher=file2 [options]...\r\nOptions:\r\n-h, --help          Prints Usage and information about acceptable flags.\r\n-v, --version       Prints current version.\r\n-m, --mode=[mode]   Starts the SCC in special mode (by default: interactive)\r\n-i, --interactive   Starts the SCC in interactive mode.\r\n--dump=[path]       Creates Tree Dump image of the AST in the [path].\r\n-l, --loglvl=lvl    Sets logging level to \"lvl\".\r\n                    Acceptable levels: SILENT, FATAL, ERROR, INFO, TRACE, DEBUG.\r\n--logdir=[path]     Path to the log directory, where will be created log file\r\n--sql=[path]        Path to the file with SQL queries, which will be converted (SQL).\r\n--cypher=[path]     Path to the file, where will be converted queries (CQL).\r\n--dump=[path]       Path to the file, where will be created image of AST of SQL queries\r\n                    (by default, the image is not created)\r\n```\r\n\r\n\r\n## How to conduct testing?\r\n\r\n---\r\n### GoogleTest\r\nWe use [GoogleTest](https://github.com/google/googletest) \r\nframework for the unit-testing.\r\nGo to the `build` folder, which was created previously,\r\nand run the following command:\r\n```shell\r\nsql2cypher/build/ $ ctest\r\n```\r\nyou will see something like this:\r\n```\r\nTest project /path/to/sql2cypher/build\r\n      Start  1: SetGetConfigTests.DefaultConfigTest\r\n 1/17 Test  #1: SetGetConfigTests.DefaultConfigTest ..........   Passed    0.02 sec\r\n      Start  2: SetGetConfigTests.ValidModeTest\r\n 2/17 Test  #2: SetGetConfigTests.ValidModeTest ..............   Passed    0.02 sec\r\n...\r\n      Start 17: AddLogTests.AddInvalidLogTest\r\n17/17 Test #17: AddLogTests.AddInvalidLogTest ................   Passed    0.04 sec\r\n\r\n100% tests passed, 0 tests failed out of 16\r\n\r\nTotal Test time (real) =   0.47 sec\r\n```\r\nYou can learn GoogleTest via this \r\n[User Guide](https://google.github.io/googletest/).\r\n\r\n### Write your own unit-tests\r\nIf you want to test some feature, you should to write your own tests\r\nand put your test file into the `test/` directory.\r\nDon't forget to change `CMakeLists.txt`!\r\n\r\n## Documentation\r\n\r\n---\r\nWe plan to write some Wiki pages on the GitHub\r\nand use Doxygen for generating documentation.\r\nWe think, it will be useful for you.\r\n\r\nFor now you can generate docs with Doxygen. Go to the root of the app directory\r\nand use the following command:\r\n```shell\r\nsql2cypher/ $ doxygen doc/doxygen-config.dox\r\n```\r\n\r\n## Authors\r\n\r\n---\r\n\r\nArtyom Fartygin ([temikfart](https://github.com/temikfart)) —\r\nUndergraduate student at [MIPT](https://mipt.ru) [PAMI](https://mipt.ru/education/departments/fpmi/)\r\n\r\nRoman Korostinskiy ([RomanKorostinskiy](https://github.com/RomanKorostinskiy)) —\r\nUndergraduate student at [MIPT](https://mipt.ru) [PRCT](https://mipt.ru/education/departments/frkt/)\r\n\r\n## Mentors\r\n\r\n---\r\n\r\nNikolay Efanov ([nefanov](https://github.com/nefanov)) —\r\nAssociate professor at [MIPT](https://mipt.ru)\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftemikfart%2Fsql2cypher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftemikfart%2Fsql2cypher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftemikfart%2Fsql2cypher/lists"}