Skip to content

Commit

Permalink
a few doc clarifications/additions
Browse files Browse the repository at this point in the history
  • Loading branch information
fegu committed Oct 6, 2020
1 parent 5f7bb7b commit f38db1b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Guide/editors.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ When using VSCode you need to install a plugin which loads the `.envrc` in your

Most likely you want to use [haskell-language-server](/~https://github.com/haskell/haskell-language-server) for smart IDE features like autocompletion and jump-to-symbol. This is not working with IHP yet. [There is an active issue to implement support for this.](/~https://github.com/digitallyinduced/ihp/issues/190)


## Using VSCode on Windows with Windows Subsystem for Linux

It is important to not access the files within the WSL from Windows itself (however, the other way around is ok). You can seamlessly (including autosave) work on your projects within WSL from VS Code in Windows by adding the `Remote WSL` extension from Microsoft.


## Using IHP with Sublime Text

Works great already out of the box.
Expand Down
6 changes: 6 additions & 0 deletions Guide/form.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,12 @@ This way no special behavior will be attached to your forms.

To dig deeper into the javascript, [take a look at the source in helpers.js](/~https://github.com/digitallyinduced/ihp/blob/master/lib/IHP/static/helpers.js#L115).


## Working within the Bootstrap CSS framework

While the default forms layout is vertical with one field per line, it is easy to change. Bootstrap's excellent [forms documentation](https://getbootstrap.com/docs/4.4/components/forms/) shows how.


## Working with other CSS Frameworks

TODO: This section still has to be implemented. The gist of how rendering can be completely overriden to support a different layout or CSS framework can be found in the implementation of [horizontalFormFor](https://ihp.digitallyinduced.com/api-docs/IHP-View-Form.html#v:horizontalFormFor) (renders a bootstrap 4 form in a horizontal way).
31 changes: 31 additions & 0 deletions Guide/querybuilder.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,37 @@ projects <- query @Project
-- Query: `SELECT * FROM projects ORDER BY created_at`
```

Nested orderBys work as expected:
```haskell
projects <- query @Employee
|> orderBy #lastname
|> orderBy #firstname
|> fetch
-- Query: `SELECT * FROM employees ORDER BY lastname, firstname`
```

## Limit

To limit the number of rows returned:
```haskell
projects <- query @Project
|> limit 10
|> fetch
-- Query: `SELECT * FROM projects LIMIT 10`
```

## Offset

To skip a number of rows:
```haskell
projects <- query @Project
|> offset 10
|> fetch
-- Query: `SELECT * FROM projects OFFSET 10`
```
Offset is most often used together with limit to implement paging.


## Or

```haskell
Expand Down

0 comments on commit f38db1b

Please sign in to comment.