Skip to content

Commit 6c902c7

Browse files
committed
add readme md
1 parent 1181c2b commit 6c902c7

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,33 @@ Make sure you have a PostgreSQL database up and running. You’ll need to provid
2929

3030
Archer relies on a table structure to manage jobs. Ensure you have run the migration script (if provided), or set up your table accordingly.
3131

32+
## How It Works
33+
34+
archer under the hood uses a table like the following.
35+
36+
```sql
37+
CREATE TABLE jobs (
38+
id varchar primary key,
39+
queue_name varchar not null,
40+
status varchar not null,
41+
arguments jsonb not null default '{}'::jsonb,
42+
result jsonb not null default '{}'::jsonb,
43+
last_error varchar,
44+
retry_count integer not null default 0,
45+
max_retry integer not null default 0,
46+
retry_interval integer not null default 0,
47+
scheduled_at timestamptz default now(),
48+
started_at timestamptz,
49+
created_at timestamptz not null default now(),
50+
updated_at timestamptz not null default now()
51+
);
52+
53+
CREATE INDEX ON jobs (queue_name);
54+
CREATE INDEX ON jobs (scheduled_at);
55+
CREATE INDEX ON jobs (status);
56+
CREATE INDEX ON jobs (started_at);
57+
```
58+
3259
## Usage
3360

3461
### Importing the package

0 commit comments

Comments
 (0)