{"id":19730574,"url":"https://github.com/begriffs/sinatra-sql","last_synced_at":"2025-10-20T00:24:45.395Z","repository":{"id":3739844,"uuid":"4813939","full_name":"begriffs/sinatra-sql","owner":"begriffs","description":"Easy PostgreSQL access with migrations in Sinatra","archived":false,"fork":false,"pushed_at":"2012-08-02T03:25:10.000Z","size":119,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-29T04:43:45.481Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"armani-dev/kernel_test","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/begriffs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-06-27T21:45:44.000Z","updated_at":"2020-09-27T19:16:01.000Z","dependencies_parsed_at":"2022-08-29T13:40:48.167Z","dependency_job_id":null,"html_url":"https://github.com/begriffs/sinatra-sql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/begriffs/sinatra-sql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/begriffs%2Fsinatra-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/begriffs%2Fsinatra-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/begriffs%2Fsinatra-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/begriffs%2Fsinatra-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/begriffs","download_url":"https://codeload.github.com/begriffs/sinatra-sql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/begriffs%2Fsinatra-sql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279952545,"owners_count":26249926,"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-19T02:00:07.647Z","response_time":64,"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":[],"created_at":"2024-11-12T00:16:50.336Z","updated_at":"2025-10-20T00:24:45.367Z","avatar_url":"https://github.com/begriffs.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Postgres access in Sinatra without an ORM\n\nThis is a Sinatra application template that provides lightweight\nSQL-only analogues to Rails' database features.\n\n* configure separate databases for each Rack environment\n* maintain versioned migrations (in raw SQL)\n* easy access to `sql` function in app code to run queries\n\nThis template is for competent Postgres users who don't want an\nobject relational mapper getting between them and their sweet, sweet\nSQL.\n\n## How to use\n\n1. clone this repo\n1. `bundle`\n1. copy `db/config.rb.example` to `db/config.rb`\n1. edit it and provide database configuration parameters\n1. `rake db:create`\n\nThe database is now ready, and at schema version 0. If you run the\napplication at this point, it will simply output this schema number.\n\n### Creating a migration\n\n1. `rake migration`\n1. it creates db/_timestamp_.up.sql and db/_timestamp_.down.sql\n1. edit these files to (un)do whatever you want\n\n### Running a migration\n\nRunning `rake db:migrate[version, environment]` will execute the\nnecessary up/down migration sql files to end up at the version\nspecified. If none is specified, i.e. `rake db:migrate`, it will\ndefault to the newest. The environment defaults to 'development.'\n\n### Executing queries\n\nIn your application code use the `sql` function. For an example\nlook in `app.rb`.\n\n## Contributing\n\nThis library would be more flexible as a gem. If anyone wants to\nhelp, your pull requests are welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbegriffs%2Fsinatra-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbegriffs%2Fsinatra-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbegriffs%2Fsinatra-sql/lists"}