Bazel

1 post

Search Learn Posts with DuckDB

 1-- Format output to display columns vertically
 2.mode line
 3
 4-- Load Learn posts
 5CREATE TABLE posts AS 
 6SELECT * FROM read_json_auto('https://quantile.co/learn/data.json');
 7
 8-- Install and load full-text search extension
 9INSTALL fts;
10LOAD fts;
11
12-- Create FTS index on searchable fields
13-- Syntax: table_name, id_column, column1, column2, ...
14PRAGMA create_fts_index('posts', 'url', 'title', 'subtitle', 'content', overwrite = 1);
15
16-- Example queries:
17
18-- 1. Full-text search for 'bazel'
19SELECT title, url, date, tags, fts_main_posts.match_bm25(url, 'bazel') as score
20FROM posts 
21WHERE score IS NOT NULL
22ORDER BY score DESC
23LIMIT 10;
24
25-- 2. Filter by specific tag (case-insensitive)
26SELECT title, url, date, tags 
27FROM posts 
28WHERE list_has(list_transform(tags, x -> lower(x)), lower('Observability'))
29ORDER BY date DESC;
30
31-- 3. Posts from last 30 days
32SELECT title, url, date, tags 
33FROM posts 
34WHERE CAST(date AS TIMESTAMP) >= CURRENT_DATE - INTERVAL 30 DAY
35ORDER BY date DESC;

Understanding Bazel Output Directories

bazel-<workspace-name>, bazel-out, bazel-bin, bazel-testlogs, ~/.cache/bazel et al.
July 23, 2025
When a Bazel build is initiated, Bazel generates a sophisticated hierarchy of out-of-source directories and artifacts (often under ~/.cache/bazel on Linux) and then symlinks to them from the project’s source tree via bazel-<workspace-name>, bazel-out, bazel-bin and bazel-testlogs. These aren’t just clutter—they’re integral to Bazel’s architectural design and execution model. Understanding each directory’s role in a conventional Bazel build is crucial to using Bazel effectively.

Subscribe, unless you hate fun

Get the latest updates and half-decent advice — straight to your inbox. No spam. Just vibes.