{"id":13733741,"url":"https://github.com/dreamRs/sqlquery","last_synced_at":"2025-05-08T09:32:51.631Z","repository":{"id":95092634,"uuid":"132266368","full_name":"dreamRs/sqlquery","owner":"dreamRs","description":"Htmlwidget to write SQL queries","archived":false,"fork":false,"pushed_at":"2018-05-09T11:27:05.000Z","size":1570,"stargazers_count":31,"open_issues_count":2,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-15T02:34:25.788Z","etag":null,"topics":["addin","htmlwidgets","r"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dreamRs.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}},"created_at":"2018-05-05T16:42:09.000Z","updated_at":"2023-09-20T04:39:18.000Z","dependencies_parsed_at":"2023-06-26T02:02:22.370Z","dependency_job_id":null,"html_url":"https://github.com/dreamRs/sqlquery","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/dreamRs%2Fsqlquery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamRs%2Fsqlquery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamRs%2Fsqlquery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamRs%2Fsqlquery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dreamRs","download_url":"https://codeload.github.com/dreamRs/sqlquery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253036769,"owners_count":21844276,"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":["addin","htmlwidgets","r"],"created_at":"2024-08-03T03:00:48.317Z","updated_at":"2025-05-08T09:32:50.916Z","avatar_url":"https://github.com/dreamRs.png","language":"JavaScript","readme":"# sqlquery\n\n\u003e SQL query editor\n\n[![Travis build status](https://travis-ci.org/dreamRs/sqlquery.svg?branch=master)](https://travis-ci.org/dreamRs/sqlquery)\n[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)\n\n\n## Overview\n\nHtmlwidget/Shiny gadget to write SQL queries with autocompletion for SQL keywords and for table names and fields.\nThere are two addins in the package, in both you can write queries, but :\n\n* **Non-interactive mode:** you cannot run queries but you keep control over your R session;\n* **Interactive mode:** you can run queries and see first rows of result.\n \n\n## Installation\n\nYou can install from Github:\n\n``` r\nsource(\"https://install-github.me/dreamRs/sqlquery\")\n```\n\n## Htmlwidget\n\nBasic usage:\n\n``` r\nlibrary(sqlquery)\nsql_query(value = \"SELECT * FROM mtcars\")\n```\n\nGet autocompletion for tables and fields in a Database:\n``` r\nlibrary(DBI)\ncon \u003c- dbConnect(RSQLite::SQLite(), \":memory:\")\ndbWriteTable(conn = con, name = \"mtcars\", value = mtcars)\n\nsql_query(conn = con)\n```\n![](img/htmlwidget.png)\n\n\n## Shiny app\n\nBasic usage:\n\n``` r\nlibrary(sqlquery)\nsql_query_app(value = \"SELECT * FROM mtcars\")\n```\n\nWith a connection :\n\n``` r\nlibrary(DBI)\ncon \u003c- dbConnect(RSQLite::SQLite(), \":memory:\")\ndbWriteTable(conn = con, name = \"mtcars\", value = mtcars)\n\nsql_query_app(conn = con)\n```\n\n![](img/shinyapp.png)\n\n\nClick button *see results* to display first rows with RStudio's `View` (if app runs in pane viewer) or in a modal (if app runs in dialog viewer or browser).\n\nTo change display mode, use: \n```r\noptions(\"sqlquery.display.mode\" = \"dialog\")\n```\n\n\n## Addins\n\nYou can launch addins via RStudio addins menu. If you want to use a connection with addins, you can set option `sqlquery.connection` in your `.Rprofile` : \n\n```r\noptions(\"sqlquery.connection\" = function() {\n  con \u003c- DBI::dbConnect(RSQLite::SQLite(), \":memory:\")\n  DBI::dbWriteTable(conn = con, name = \"mtcars\", value = mtcars)\n  return(con)\n})\n```\n\nThis has to be a function returning a connection.\n\nIf you want to use a default schema, use: \n\n```r\noptions(\"sqlquery.schema\" = \"myschema\")\n```\n\n","funding_links":[],"categories":["UI Components","JavaScript"],"sub_categories":["Editor"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FdreamRs%2Fsqlquery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FdreamRs%2Fsqlquery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FdreamRs%2Fsqlquery/lists"}