Skip to content

Commit d00f4de

Browse files
committed
more instructions in dashboard + log 1000 lines
1 parent 747a6ac commit d00f4de

2 files changed

Lines changed: 25 additions & 6 deletions

File tree

server/sync-agent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export default class SyncAgent {
229229
const user = {};
230230
processed += 1;
231231

232-
if (processed % 100 === 0) {
232+
if (processed % 1000 === 0) {
233233
const elapsed = new Date() - started_sync_at;
234234
this.hull.logger.info("sync.progress", { processed, elapsed });
235235
if (this.job) {

views/connected.html

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,30 @@ <h4 class="mt-0 text-muted">SQL Query</h4>
3434
<textarea name="" rows="15" id="querying" class="form-control"><%= query %></textarea>
3535

3636
<div class="pt-1 pb-1 text-muted">
37-
<p>You can run incremental queries based on the date of the last sync. <br />The query will be rewritten to replace <code>:last_updated_at</code> with the date of the last successful sync operation.</p>
38-
<br />
39-
<p>For example to import entries from a <code>users</code> table with a date column named <code>updated_at</code>, you can write :</p>
40-
<code>SELECT id as external_id, email as email FROM users WHERE updated_at >= :last_updated_at</code>
41-
<hr />
37+
<h6>How to write queries</h6>
38+
<p>
39+
Valid queries MUST expose an `external_id` column or an `email` column. Lines with no `external_id` or `email` will be ignored.
40+
<br />
41+
All other fields will be imported as traits on the matching users.
42+
<br />
43+
For example, the following query will map the column `users.id` to your Hull users' `external_id`.
44+
<pre><code>
45+
SELECT user_id as external_id, plan_name, monthly_amount FROM users_subscriptions
46+
</code></pre>
47+
</p>
48+
<h6>Using incremental queries</h6>
49+
<p>
50+
You can run incremental queries based on the date of the last sync.
51+
<br />
52+
The query will be rewritten to replace <code>:last_updated_at</code> with the date of the last successful sync operation.
53+
<br /><br />
54+
For example to import entries from a <code>users</code> table with a date column named <code>updated_at</code>, you can write :
55+
<pre><code>
56+
SELECT id as external_id, email as email, firstname as first_name
57+
FROM users
58+
WHERE updated_at >= :last_updated_at
59+
</code></pre>
60+
</p>
4261
</div>
4362

4463
<div class="pt-1 pb-1">

0 commit comments

Comments
 (0)