{"id":16176107,"url":"https://github.com/piotr-kalanski/class2sql","last_synced_at":"2025-10-31T07:36:29.593Z","repository":{"id":57722112,"uuid":"94556805","full_name":"piotr-kalanski/class2sql","owner":"piotr-kalanski","description":"SQL insert statements generator based on Scala case class.","archived":false,"fork":false,"pushed_at":"2017-12-05T09:34:17.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"development","last_synced_at":"2025-02-13T13:50:25.258Z","etag":null,"topics":["scala","sql"],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/piotr-kalanski.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-06-16T15:22:53.000Z","updated_at":"2017-06-16T20:18:18.000Z","dependencies_parsed_at":"2022-08-29T23:00:25.030Z","dependency_job_id":null,"html_url":"https://github.com/piotr-kalanski/class2sql","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotr-kalanski%2Fclass2sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotr-kalanski%2Fclass2sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotr-kalanski%2Fclass2sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotr-kalanski%2Fclass2sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piotr-kalanski","download_url":"https://codeload.github.com/piotr-kalanski/class2sql/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640475,"owners_count":20971558,"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":["scala","sql"],"created_at":"2024-10-10T04:47:43.233Z","updated_at":"2025-10-31T07:36:24.540Z","avatar_url":"https://github.com/piotr-kalanski.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# class2sql\n\nSQL insert and select statements generator based on Scala case class.\n\n[![Build Status](https://api.travis-ci.org/piotr-kalanski/class2sql.png?branch=development)](https://api.travis-ci.org/piotr-kalanski/class2sql.png?branch=development)\n[![codecov.io](http://codecov.io/github/piotr-kalanski/class2sql/coverage.svg?branch=development)](http://codecov.io/github/piotr-kalanski/class2sql/coverage.svg?branch=development)\n[\u003cimg src=\"https://img.shields.io/maven-central/v/com.github.piotr-kalanski/class2sql_2.11.svg?label=latest%20release\"/\u003e](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22class2sql_2.11%22)\n[![Stories in Ready](https://badge.waffle.io/piotr-kalanski/class2sql.png?label=Ready)](https://waffle.io/piotr-kalanski/class2sql)\n[![License](http://img.shields.io/:license-Apache%202-red.svg)](http://www.apache.org/licenses/LICENSE-2.0.txt)\n\n# Table of contents\n\n- [Goals](#goals)\n- [Getting started](#getting-started)\n- [Examples](#examples)\n\n# Goals\n\n- Provide simple tool for generating SQL inserts based on Scala case classes\n- Provide easy API to query JDBC table and map result to Scala case class\n\n# Getting started\n\n## Include dependencies\n\n```scala\n\"com.github.piotr-kalanski\" % \"class2sql_2.11\" % \"0.1.0\"\n```\n\nor\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.piotr-kalanski\u003c/groupId\u003e\n    \u003cartifactId\u003eclass2sql_2.11\u003c/artifactId\u003e\n    \u003cversion\u003e0.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n# Examples\n\n## Generate inserts\n\n```scala\nimport com.datawizards.class2jdbc._\n\ncase class Person(name: String, age: Int)\n\nval data = Seq(Person(\"p1\", 1), Person(\"p2\", 2))\ngenerateInserts(data)\n```\n\n```sql\nINSERT INTO Person(name,age) VALUES('p1',1)\nINSERT INTO Person(name,age) VALUES('p2',2)\n```\n\n## Select from table\n\n```scala\nimport com.datawizards.jdbc2class._\n\ncase class Person(name: String, age: Int)\n\nval connectionString = \"jdbc:h2:mem:test\"\nval connection = DriverManager.getConnection(connectionString, \"\", \"\")\nselectTable[Person](connection, \"people\")\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiotr-kalanski%2Fclass2sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiotr-kalanski%2Fclass2sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiotr-kalanski%2Fclass2sql/lists"}