{"id":49440138,"url":"https://github.com/mikelue/foxglove","last_synced_at":"2026-04-29T19:35:51.212Z","repository":{"id":323447676,"uuid":"1093242209","full_name":"mikelue/foxglove","owner":"mikelue","description":"A rule-based library to generate data for RDB","archived":false,"fork":false,"pushed_at":"2026-03-14T10:35:38.000Z","size":4588,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-14T18:10:53.790Z","etag":null,"topics":["database","java","jdbc","junit","springframework","unittest"],"latest_commit_sha":null,"homepage":"","language":"Java","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/mikelue.png","metadata":{"files":{"readme":"README.adoc","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-10T05:26:10.000Z","updated_at":"2026-03-14T10:35:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mikelue/foxglove","commit_stats":null,"previous_names":["mikelue/foxglove"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mikelue/foxglove","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikelue%2Ffoxglove","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikelue%2Ffoxglove/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikelue%2Ffoxglove/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikelue%2Ffoxglove/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikelue","download_url":"https://codeload.github.com/mikelue/foxglove/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikelue%2Ffoxglove/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32441407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T18:12:22.909Z","status":"ssl_error","status_checked_at":"2026-04-29T18:11:33.322Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["database","java","jdbc","junit","springframework","unittest"],"created_at":"2026-04-29T19:35:50.623Z","updated_at":"2026-04-29T19:35:51.204Z","avatar_url":"https://github.com/mikelue.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":":foxglove-url: https://foxglove.mikelue.guru\n:instancio-link: https://www.instancio.org/user-guide/[Instancio]\n\nhttps://foxglove.mikelue.guru/[image:https://img.shields.io/maven-central/v/guru.mikelue.foxglove/core[Official Foxglove Site]]\nhttps://github.com/mikelue/foxglove[image:https://img.shields.io/badge/Git-Foxglove-darkorange?logo=github\u0026labelColor=lightslategray[Git Repository GitHub]]\nhttps://foxglove.mikelue.guru/maven-site/project-info.html[image:https://img.shields.io/badge/Foxglove-darkorange?logo=apachemaven\u0026label=Maven%20Site\u0026labelColor=lightslategray[Project information Maven site]]\nhttps://foxglove.mikelue.guru/maven-site/apidocs/[image:https://img.shields.io/badge/Foxglove-darkorange?logo=htmx\u0026label=Javadoc\u0026labelColor=lightslategray[Javadocs]]\n\n\nhttps://github.com/mikelue/foxglove/commits/main/[image:https://img.shields.io/github/last-commit/mikelue/foxglove?logo=git\u0026labelColor=bisque\u0026color=lightsteelblue[Last Commit]]\nhttps://github.com/mikelue/foxglove/actions/workflows/maven-publish.yml[image:https://img.shields.io/github/actions/workflow/status/mikelue/foxglove/maven-publish.yml?branch=main\u0026logo=githubactions\u0026label=Build\u0026labelColor=goldenrod\u0026color=lightgreen[Maven Publish]]\nhttps://foxglove.mikelue.guru/clover/[image:https://img.shields.io/badge/OpenClover-darkgoldenrod?logo=codecov\u0026label=Code%20Coverage\u0026labelColor=mediumaquamarine[OpenClover Report]]\nhttps://github.com/mikelue/foxglove?tab=MIT-1-ov-file#readme[image:https://img.shields.io/github/license/mikelue/foxglove?labelColor=steelblue\u0026color=skyblue[MIT License]]\n\n## Motivation\n\nWhen we are preparing data of RDB for tests, the tedious and tricky part is to write correct https://en.wikipedia.org/wiki/Data_manipulation_language[DML] for data insertion.\n{foxglove-url}[Foxglove] is a library that helps you to generating data by auto schema-inspection and table facet(rules to generate data).\n\nWhile preparing data for unit tests over databases, the key things are:\n\n. Preparing values for columns in `WHERE` clause of SQL or clause may *FILTERING* data(e.g. `INNER JOIN`).\n. Some critical values to be asserted or counting number of results affected by exercised SQL.\n. While tearing down the tests, you may like to delete only the data you have inserted.\n\t* Specify some fixed values to irrelevant columns could help\n\nThat is, how {foxglove-url}[Foxglove] helps you:\n\n. Just provide values for specified columns.\n. Give the critical values you need to check.\n. Don't have to care about irrelevant, _non-nullable(and no default value)_ columns.\n\nOther data that is irrelevant to your tests will be _generated automatically_ by {foxglove-url}[Foxglove].\n\n---\n\n.Preparing data\n[source,java]\n----\n// Generates 4 rows with \"cr_brand \"fixed to \"Toyota\" and\n// 4 different values on \"cr_model\"\nvar facet = JdbcTableFacet.builder(TABLE_CAR)\n    .numberOfRows(4)\n    .column(\"cr_brand\")\n        .fixed(\"Toyota\")\n    .column(\"cr_model\")\n        .roundRobin(\"Corolla\", \"Camry\", \"RAV4\", \"Prius\")\n    .build();\n\nnew JdbcDataGenerator(getDataSource())\n    .generate(facet);\n----\n\nThe data could be used for:\n\n. There could be `0 ~ 1` matched row for any query of the SQL\n+\n[source,sql]\n----\nSELECT *\nFROM ap_car\nWHERE cr_brand = ?\n    AND cr_model = ?\n----\n\n. Since `cr_created_at` will be generated randomly by default,\n\tyou can check the values of the column for the correctness of ordering.\n+\n[source,sql]\n----\nSELECT *\nFROM ap_car\nWHERE cr_brand = ?\nORDER BY cr_created_at DESC\n----\n\n## Requirements\n\n* https://openjdk.org/projects/jdk/17/[Java 17+]\n\n## Integration\n\n* See {foxglove-url}/quickstart/junit[JUnit 5 Quick Start] for usage with https://docs.junit.org/5.10.5/user-guide/https://docs.junit.org/5.10.5/user-guide/[JUnit 5].\n* See {foxglove-url}/quickstart/springframework[SpringFramework Quick Start] for usage with https://docs.spring.io/spring-framework/reference/6.0/testing/support-jdbc.html[SprinFramwork - JDBC Testing Support].\n\n## Documentations\n\n* {foxglove-url}/quickstart/[Quick starts], {foxglove-url}/docs/[Docs]\n* {foxglove-url}/maven-site/apidocs[Javadocs(Maven Site)], {foxglove-url}/maven-site/project-info.html[Maven Site]\n\n## Installation\n\nSee {foxglove-url}/quickstart[Quick start] for details.\n\n## Credits\n\nThanks to {instancio-link} project for its excellent data generation capabilities.\n\nhttps://docs.junit.org/5.10.5/user-guide/[image:https://img.shields.io/badge/dynamic/xml?url=https%3A%2F%2Fraw.githubusercontent.com%2Fmikelue%2Ffoxglove%2Frefs%2Fheads%2Fmain%2Fpom.xml\u0026query=%2F*%5Blocal-name()%3D%27project%27%5D%2F*%5Blocal-name()%3D%27properties%27%5D%2F*%5Blocal-name()%3D%27version.junit%27%5D\u0026logo=junit5\u0026label=JUnit[\"Dynamic XML Badge\"]]\nhttps://docs.spring.io/spring-framework/reference/6.0/index.html[image:https://img.shields.io/badge/dynamic/xml?url=https%3A%2F%2Fraw.githubusercontent.com%2Fmikelue%2Ffoxglove%2Frefs%2Fheads%2Fmain%2Fpom.xml\u0026query=%2F*%5Blocal-name()%3D%27project%27%5D%2F*%5Blocal-name()%3D%27properties%27%5D%2F*%5Blocal-name()%3D%27version.spring%27%5D\u0026logo=spring\u0026label=SpringFramework[SpringFramework]]\nlink:https://docs.spring.io/spring-boot/docs/3.1.x/reference/html/[image:https://img.shields.io/badge/dynamic/xml?url=https%3A%2F%2Fraw.githubusercontent.com%2Fmikelue%2Ffoxglove%2Frefs%2Fheads%2Fmain%2Fpom.xml\u0026query=%2F*%5Blocal-name()%3D%27project%27%5D%2F*%5Blocal-name()%3D%27properties%27%5D%2F*%5Blocal-name()%3D%27version.spring-boot%27%5D\u0026logo=springboot\u0026label=SpringFramework[SpringBoot]]\nlink:https://www.instancio.org/user-guide/[image:https://img.shields.io/badge/dynamic/xml?url=https%3A%2F%2Fraw.githubusercontent.com%2Fmikelue%2Ffoxglove%2Frefs%2Fheads%2Fmain%2Fpom.xml\u0026query=%2F*%5Blocal-name()%3D%27project%27%5D%2F*%5Blocal-name()%3D%27properties%27%5D%2F*%5Blocal-name()%3D%27version.spring-boot%27%5D\u0026logo=springboot\u0026label=SpringFramework[Instancio]]\nlink:https://openclover.org/documentation[image:https://img.shields.io/badge/dynamic/xml?url=https%3A%2F%2Fraw.githubusercontent.com%2Fmikelue%2Ffoxglove%2Frefs%2Fheads%2Fmain%2Fpom.xml\u0026query=%2F*%5Blocal-name()%3D%27project%27%5D%2F*%5Blocal-name()%3D%27properties%27%5D%2F*%5Blocal-name()%3D%27version.plugin.clover%27%5D\u0026logo=codecov\u0026label=OpenClover[OpenClover]]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikelue%2Ffoxglove","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikelue%2Ffoxglove","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikelue%2Ffoxglove/lists"}