Skip to content

Commit

Permalink
README suggestion of .sq files in src/main/sqldelight (#1212)
Browse files Browse the repository at this point in the history
As a first time user of the library I was putting my `.sq` files in `src/main/java/com...` and didn't understand why codegen wasn't working.  There was a small note in the current README showing an example file path which included `src/main/sqldelight`, but it wasn't clearly called out as a requirement as a first time user, without custom gradle plugin configuration.

I'm submitting this change in hopes that it will improve the first time experience of using SqlDelight and avoid my 30 minutes of trying to figure out why it wasn't generating sources: https://twitter.com/HandstandSam/status/1093513648885116928
  • Loading branch information
handstandsam authored and Alec Strong committed Feb 7, 2019
1 parent 25755d6 commit b3d76cf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ SQLDelight generates typesafe APIs from your SQL statements. It compile-time ver
Example
-------

To use SQLDelight, apply the [gradle plugin](https://github.com/square/sqldelight#gradle) and put your SQL statements in a `.sq` file, like
`src/main/sqldelight/com/example/HockeyPlayer.sq`. Typically the first statement creates a table.
To use SQLDelight, apply the [gradle plugin](https://github.com/square/sqldelight#gradle) and put your SQL statements in a `.sq` file in `src/main/sqldelight`. Typically the first statement in the SQL file creates a table.

```sql
-- src/main/sqldelight/com/example/sqldelight/hockey/data/Player.sq

CREATE TABLE hockeyPlayer (
player_number INTEGER NOT NULL,
full_name TEXT NOT NULL
Expand Down

0 comments on commit b3d76cf

Please sign in to comment.