Skip to content

Commit 3858065

Browse files
authored
Rename DinoSQL to sqlc (sqlc-dev#63)
* Rename DinoSQL to sqlc * Publish sqlc using Equinox
1 parent b0745a4 commit 3858065

File tree

6 files changed

+73
-53
lines changed

6 files changed

+73
-53
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: dinosql test suite
1+
name: sqlc test suite
22
on: [push]
33
jobs:
44

@@ -26,10 +26,10 @@ jobs:
2626
with:
2727
version: 1.12
2828

29-
- name: Test dinosql
29+
- name: Test sqlc
3030
run: go test -v ./...
3131

32-
- name: Test dinosql/ondeck
32+
- name: Test sqlc/ondeck
3333
run: go test -v ./...
3434
working-directory: internal/dinosql/testdata/ondeck
3535
env:

.github/workflows/equinox.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish to Equinox
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
10+
macos:
11+
name: Build on macOS
12+
runs-on: macos-latest
13+
steps:
14+
- uses: actions/checkout@master
15+
- run: brew install eqnxio/equinox/release-tool
16+
- name: equinox release
17+
env:
18+
EQUINOX_API_TOKEN: ${{ secrets.EQUINOX_API_TOKEN }}
19+
EQUINOX_SIGNING_KEY: ${{ secrets.EQUINOX_SIGNING_KEY }}
20+
run: equinox release --channel devel --version=$GITHUB_SHA --draft --platforms=darwin_amd64 --app=app_i4iCp1SuYfZ --token=$EQUINOX_API_TOKEN github.com/kyleconroy/sqlc
21+
22+
linux:
23+
name: Build on Linux
24+
runs-on: ubuntu-latest
25+
needs: [macos]
26+
steps:
27+
- uses: actions/checkout@master
28+
- run: curl -O https://bin.equinox.io/c/mBWdkfai63v/release-tool-stable-linux-amd64.tgz
29+
- run: tar -xzvf release-tool-stable-linux-amd64.tgz
30+
- name: equinox release
31+
env:
32+
EQUINOX_API_TOKEN: ${{ secrets.EQUINOX_API_TOKEN }}
33+
EQUINOX_SIGNING_KEY: ${{ secrets.EQUINOX_SIGNING_KEY }}
34+
run: ./equinox release --channel devel --version=$GITHUB_SHA --platforms=linux_amd64 --app=app_i4iCp1SuYfZ --token=$EQUINOX_API_TOKEN github.com/kyleconroy/sqlc
35+
36+

.semaphore/semaphore.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

README.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
11
> 🚨
22
>
3-
> DinoSQL is **very new** and under rapid development.
3+
> sqlc is **very new** and under rapid development.
44
>
55
> The code it generates is correct and safe for production use, but
66
> there is currently no garantee of stability or backwards-compatibility of
77
> the command line interface, configuration file format or generated code.
88
>
99
> 🚨
1010
11-
# Dino: A SQL Compiler
11+
# sqlc: A SQL Compiler
1212

1313
> And lo, the Great One looked down upon the people and proclaimed:
1414
>
1515
> "SQL is actually pretty great"
1616
17-
DinoSQL generates **fully-type safe idiomatic Go code** from SQL. Here's how it works:
17+
sqlc generates **fully-type safe idiomatic Go code** from SQL. Here's how it works:
1818

1919
1. You write SQL queries
20-
1. You run the DinoSQL tool to generate Go code that presents type-safe interfaces to those queries
21-
1. You write application code that calls the methods DinoSQL generated.
20+
1. You run sqlc to generate Go code that presents type-safe interfaces to those queries
21+
1. You write application code that calls the methods sqlc generated.
2222

2323
Seriously, it's that easy. You don't have to write any boilerplate SQL querying code ever again.
2424

2525
## Preventing Errors
26-
But DinoSQL doesn't just make you more productive by generating boilerplate for you.
27-
DinoSQL **also prevents entire classes of common errors in SQL code**. Have you ever:
26+
But sqlc doesn't just make you more productive by generating boilerplate for you.
27+
sqlc **also prevents entire classes of common errors in SQL code**. Have you ever:
2828

2929
- Mixed up the order of the arguments when invoking the query so they didn't match up with the SQL text
3030
- Updated the name of a column in one query both not another
3131
- Mistyped the name of a column in a query
3232
- Changed the number of arguments in a query but forgot to pass the additional values
3333
- Changed the type of a column but forgot to change the type in your code?
3434

35-
All of these errors are *impossible* with DinoSQL. Wait, what? How?
35+
All of these errors are *impossible* with sqlc. Wait, what? How?
3636

37-
DinoSQL parses your all of your queries and the DDL (e.g. `CREATE TABLE`) statements during the code generation processes
37+
sqlc parses your all of your queries and the DDL (e.g. `CREATE TABLE`) statements during the code generation processes
3838
so that it knows the names and types of every column in your tables and every expression in your queries.
39-
If any of them do not match, DinoSQL *will fail to compile your queries*, preventing entire classes of runtime problems
39+
If any of them do not match, sqlc *will fail to compile your queries*, preventing entire classes of runtime problems
4040
at compile time.
4141

42-
Likewise, the methods that DinoSQL generates for you have a stricty arity and correct Go type definitions that match your columns. So if you
42+
Likewise, the methods that sqlc generates for you have a stricty arity and correct Go type definitions that match your columns. So if you
4343
change a query's arguments or a column's type but don't update your code, it will fail to compile.
4444

4545
## Getting Started
4646
Okay, enough hype, let's see it in action.
4747

48-
First you pass the following SQL to `dinosql generate`:
48+
First you pass the following SQL to `sqlc generate`:
4949

5050
```sql
5151
CREATE TABLE authors (
@@ -105,7 +105,7 @@ if err != nil {
105105
fmt.Println(reflect.DeepEqual(insertedAuthor, fetchedAuthor))
106106
```
107107

108-
To make that possible, DinoSQL generates readable, **idiomatic** Go code that you otherwise would have had to write yourself. Take a look:
108+
To make that possible, sqlc generates readable, **idiomatic** Go code that you otherwise would have had to write yourself. Take a look:
109109

110110
```go
111111
package db
@@ -240,31 +240,31 @@ Your favorite PostgreSQL / Go features are supported:
240240
- [Goose migrations](./examples/goose.md)
241241

242242
A full, end-to-end example can be found in the sample
243-
[`ondeck`](./internal/dinosql/testdata/ondeck) package.
243+
[`ondeck`](./internal/sqlc/testdata/ondeck) package.
244244

245245
## Usage
246246

247247
```
248248
Usage:
249-
dinosql [command]
249+
sqlc [command]
250250
251251
Available Commands:
252252
compile Statically check SQL for syntax and type errors
253253
generate Generate Go code from SQL
254254
help Help about any command
255-
init Create an empty dinosql.json settings file
256-
version Print the DinoSQL version number
255+
init Create an empty sqlc.json settings file
256+
version Print the sqlc version number
257257
258258
Flags:
259-
-h, --help help for dinosql
259+
-h, --help help for sqlc
260260
261-
Use "dinosql [command] --help" for more information about a command.
261+
Use "sqlc [command] --help" for more information about a command.
262262
```
263263

264264
## Settings
265265

266-
The `dinosql` tool is configured via a `dinosql.json` file. This file must be
267-
in the directory where the `dinosql` command is run.
266+
The `sqlc` tool is configured via a `sqlc.json` file. This file must be
267+
in the directory where the `sqlc` command is run.
268268

269269
```json
270270
{
@@ -297,19 +297,19 @@ Each package document has the following keys:
297297

298298
## Downloads
299299

300-
Each commit is deployed to the [`devel` channel on Equinox](https://dl.equinox.io/dinosql/dinosql/devel):
301-
- [Linux](https://bin.equinox.io/c/jUfda88XW4i/dinosql-devel-linux-amd64.tgz)
302-
- [macOS](https://bin.equinox.io/c/jUfda88XW4i/dinosql-devel-darwin-amd64.zip)
300+
Each commit is deployed to the [`devel` channel on Equinox](https://dl.equinox.io/sqlc/sqlc/devel):
301+
- [Linux](https://bin.equinox.io/c/jUfda88XW4i/sqlc-devel-linux-amd64.tgz)
302+
- [macOS](https://bin.equinox.io/c/jUfda88XW4i/sqlc-devel-darwin-amd64.zip)
303303

304304
## Other Database Engines
305305

306-
DinoSQL currently only supports PostgreSQL. If you'd like to support another database, we'd welcome a contribution.
306+
sqlc currently only supports PostgreSQL. If you'd like to support another database, we'd welcome a contribution.
307307

308308
## Other Language Backends
309309

310-
DinoSQL currently only generates Go code, but if you'd like to build another language backend, we'd welcome a contribution.
310+
sqlc currently only generates Go code, but if you'd like to build another language backend, we'd welcome a contribution.
311311

312312
## Acknowledgements
313313

314-
DinoSQL was inspired by [PugSQL](https://pugsql.org/) and
314+
sqlc was inspired by [PugSQL](https://pugsql.org/) and
315315
[HugSQL](https://www.hugsql.org/).
File renamed without changes.

internal/cmd/cmd.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818

1919
// Do runs the command logic.
2020
func Do(args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) int {
21-
rootCmd := &cobra.Command{Use: "dinosql", SilenceUsage: true}
21+
rootCmd := &cobra.Command{Use: "sqlc", SilenceUsage: true}
2222
rootCmd.AddCommand(checkCmd)
2323
rootCmd.AddCommand(genCmd)
2424
rootCmd.AddCommand(initCmd)
@@ -42,7 +42,7 @@ func Do(args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) int
4242

4343
var versionCmd = &cobra.Command{
4444
Use: "version",
45-
Short: "Print the DinoSQL version number",
45+
Short: "Print the sqlc version number",
4646
Run: func(cmd *cobra.Command, args []string) {
4747
fmt.Println("v0.0.1")
4848
},
@@ -69,24 +69,24 @@ var parseCmd = &cobra.Command{
6969

7070
var initCmd = &cobra.Command{
7171
Use: "init",
72-
Short: "Create an empty dinosql.json settings file",
72+
Short: "Create an empty sqlc.json settings file",
7373
RunE: func(cmd *cobra.Command, args []string) error {
74-
if _, err := os.Stat("dinosql.json"); !os.IsNotExist(err) {
74+
if _, err := os.Stat("sqlc.json"); !os.IsNotExist(err) {
7575
return nil
7676
}
7777
blob, err := json.MarshalIndent(dinosql.GenerateSettings{}, " ", "")
7878
if err != nil {
7979
return err
8080
}
81-
return ioutil.WriteFile("dinosql.json", blob, 0644)
81+
return ioutil.WriteFile("sqlc.json", blob, 0644)
8282
},
8383
}
8484

8585
var genCmd = &cobra.Command{
8686
Use: "generate",
8787
Short: "Generate Go code from SQL",
8888
RunE: func(cmd *cobra.Command, args []string) error {
89-
blob, err := ioutil.ReadFile("dinosql.json")
89+
blob, err := ioutil.ReadFile("sqlc.json")
9090
if err != nil {
9191
return err
9292
}
@@ -127,7 +127,7 @@ var checkCmd = &cobra.Command{
127127
Use: "compile",
128128
Short: "Statically check SQL for syntax and type errors",
129129
RunE: func(cmd *cobra.Command, args []string) error {
130-
blob, err := ioutil.ReadFile("dinosql.json")
130+
blob, err := ioutil.ReadFile("sqlc.json")
131131
if err != nil {
132132
return err
133133
}

0 commit comments

Comments
 (0)