Web Development with Clojure, Third Edition (vB17.0): create table syntax invalid

Title: Web Development with Clojure, Third Edition, vB17.0 (p9)
The create table guestbook
syntax suggested doesn’t seem to be accepted by h2:
Syntax error in SQL statement "CREATE TABLE GUESTBOOK (
ID INTEGER PRIMARY KEY AUTO_INCREMENT[*],
NAME VARCHAR(30),
MESSAGE VARCHAR(30),
TIMESTAMP TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);"; expected "HASH, AUTO_INCREMENT, NOT, NULL, COMMENT, CHECK, REFERENCES, ,, )"; SQL statement:
create table guestbook (
id integer primary key auto_increment,
name varchar(30),
message varchar(30),
timestamp timestamp default current_timestamp
); [42001-200]
From what I can tell, the problem is the order of clauses for the id
column. Putting auto_increment
before primary key
works as intended.
This applies to both the book and the downloadable source code.
The h2 documentation confirms this requirement.
Popular Pragprog topics

In Chapter 3, the source for index introduces Config on page 31, followed by more code including tests; Config isn’t introduced until pag...
New

Running the examples in chapter 5 c under pytest 5.4.1 causes an AttributeError: ‘module’ object has no attribute ‘config’.
In particula...
New

Hi Travis! Thank you for the cool book! :slight_smile:
I made a list of issues and thought I could post them chapter by chapter. I’m rev...
New

I can’t setup the Rails source code. This happens in a working directory containing multiple (postgres) Rails apps.
With:
ruby-3.0.0
s...
New

Title: Intuitive Python: docker run… denied error (page 2)
Attempted to run the docker command in both CLI and Powershell
PS C:\Users\r...
New

When I run the coverage example to report on missing lines, I get:
pytest --cov=cards --report=term-missing ch7
ERROR: usage: pytest [op...
New

It seems the second code snippet is missing the code to set the current_user:
current_user: Accounts.get_user_by_session_token(session[&...
New

Hi,
I am getting an error I cannot figure out on my test.
I have what I think is the exact code from the book, other than I changed “us...
New

@mfazio23
I’m following the indications of the book and arriver ad chapter 10, but the app cannot be compiled due to an error in the Bas...
New

root_layout: {PentoWeb.LayoutView, :root},
This results in the following following error:
no “root” html template defined for PentoWeb...
New
Other popular topics

Bought the Moonlander mechanical keyboard. Cherry Brown MX switches. Arms and wrists have been hurting enough that it’s time I did someth...
New

I have seen the keycaps I want - they are due for a group-buy this week but won’t be delivered until October next year!!! :rofl:
The Ser...
New

Seems like a lot of people caught it - just wondered whether any of you did?
As far as I know I didn’t, but it wouldn’t surprise me if I...
New

We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New

Author Spotlight: James Stanier (@jstanier)
James Stanier, author of Effective Remote Work , discusses how to rethink the office as we...
New

Author Spotlight: Jamis Buck (@jamis)
This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for P...
New

Author Spotlight: Mike Riley (@mriley)
This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s bo...
New

Author Spotlight: Erin Dees (@undees)
Welcome to our new author spotlight! We had the pleasure of chatting with Erin Dees, co-author ...
New

Large Language Models like ChatGPT say The Darnedest Things.
The Errors They MakeWhy We Need to Document Them, and What We Have Decided ...
New

A Ruby-Centric Chat with Noel Rappin @noelrappin
Once you start noodling around with Ruby you quickly figure out, as Noel Rappi...
New
Latest in Pragprog
Latest (all)
Categories:
My Saved Portals
-
None saved yet
Popular Portals
- /elixir
- /opensuse
- /rust
- /kotlin
- /ruby
- /erlang
- /python
- /clojure
- /react
- /quarkus
- /go
- /vapor
- /v
- /react-native
- /wasm
- /security
- /django
- /nodejs
- /centos
- /haskell
- /rails
- /fable
- /gleam
- /swift
- /js
- /deno
- /assemblyscript
- /tailwind
- /laravel
- /symfony
- /phoenix
- /crystal
- /typescript
- /debian
- /adonisjs
- /julia
- /arch-linux
- /svelte
- /spring
- /c-plus-plus
- /preact
- /flutter
- /actix
- /java
- /angular
- /ocaml
- /zig
- /kubuntu
- /scala
- /zotonic
- /vim
- /rocky
- /lisp
- /html
- /keyboards
- /vuejs
- /nim
- /emacs
- /nerves
- /elm