Quickstart
This is a quick guide to get you started with CloudQuery CLI syncs from Hacker News to SQLite. The easiest way to start with CloudQuery and sync with an arbitrary source and destination is to just sign up and follow your tailored setup guide.
Download CloudQuery CLI
You can download the precompiled binary from releases, or using CLI:
curl -L https://github.com/cloudquery/cloudquery/releases/download/cli-v6.27.0/cloudquery_linux_amd64 -o cloudquery
chmod a+x cloudquery
Sign in with CloudQuery
To sign in from the CLI, run the following command:
./cloudquery login
A new browser window will open where you will complete the sign-in process.
You will be able to create a new account when you sign in with the CLI for the first time. Alternatively, head to CloudQuery Cloud to create a new account.
Create a Sync Configuration
CloudQuery supports many sources and destinations.
In this guide we’ll create a configuration to sync from the Hacker News source to the SQLite destination using the init
command.
Run the following command to create a configuration file:
./cloudquery init --source hackernews --destination sqlite --spec-path hackernews_to_sqlite.yaml
To pick from a list of available sources and destinations, run the init
command without any arguments.
Start Syncing
Run the following command to start syncing:
./cloudquery sync hackernews_to_sqlite.yaml
You should see a spinner with number of resources synced and the time it took to sync.
The sync will take a few seconds and it will load articles from the past 3 hours. You can configure the maximum age of the articles by changing the start_time
in the hackernews_to_sqlite.yaml
config file.
Examine the Data
Once the sync is done you can query the data via the database directly via the sqlite3
command line tool or any other SQLite client.
Run the following command to list the top articles:
./sqlite3 db.sql -markdown "select url, score from hackernews_items order by score desc limit 5"
The output should look like this:
| url | score |
|---------------------------------------------------------------|-------|
| https://github.com/ClemensElflein/OpenMower | 268 |
| https://divernet.com/scuba-news/freediving/... | 191 |
| https://linch.substack.com/p/ted-chiang-review | 95 |
| https://www.binarly.io/blog/persistent-risk... | 88 |
| https://jslegenddev.substack.com/p/how-to-s... | 70 |
Next Steps
Now that you have successfully synced data from the Hacker News source to the SQLite destination, you can explore more sources and destinations:
- Use our Getting Started guide to walk you through a sync setup for an arbitrary source and destination.
- Explore Source Integrations to find more sources to sync from.
- See Destination Integrations for all the supported destinations to sync to, such as PostgreSQL, BigQuery, or S3.
- Learn how to deploy CloudQuery in a production environment.
- Visit our Website for more information