Coming from…

Coming from SQL, pandas or dbt

If you work in SQL, pandas, Polars or dbt, you already know every step Locra offers. The nodes are those steps with a form in front of them. Underneath, each node is code you can read, and you can always drop back to writing SQL or Python yourself.

What feels familiar

  • It runs on DuckDB. Most nodes run as DuckDB SQL, so DuckDB functions and types behave the way you expect. The Metadata tab shows each column's DuckDB type.
  • Write SQL when it's faster. A DuckDB Query node takes any query, CTEs and window functions included.
  • Python is one click away. Every node's code is Python. Click the pencil to edit it by hand, or use a Custom Node for your own function. A Code Gen node writes the Python from a plain-language description.
  • Your workflow can leave the app. Export as Python library turns the project into an installable Python package. One call runs the whole workflow, and each node can be imported on its own.

What's different

  • Edges replace ref() and variable names. You wire one node's output to the next instead of naming tables.
  • Every step keeps its result. Select any node to see its rows under the canvas. Run recomputes only the nodes that are out of date, so you don't re-run a whole notebook to check one step.
  • Tests are nodes too. dbt-style tests become Assert (stops the run) or Expectations (reports, never stops).
  • No upserts yet. Write to DB replaces or appends a table. MERGE and ON CONFLICT have no equivalent yet.

SQL/pandas names in Locra

You don't need this table open while you work. Type a SQL/pandas name into the add-node menu (right-click the canvas) or the command palette (⌘K, Ctrl+K on Windows). The matching Locra node shows up with a small chip, such as SQL/pandas: GROUP BY, so you learn our name as you go.

SQL

SQL/pandas nameLocra
SELECTSelect Columns or Add Column
SELECT * EXCLUDESelect Columns
WHEREFilter or Replace Values
CASE WHENAdd Column or Switch
CASTCast Types
TRY_CASTCast Types or Parse
COALESCEFill Missing or Add Column
GROUP BYAggregate or Group Aggregate
HAVINGFilter or Aggregate
ORDER BYSort
LIMITRow Limit or Top / Bottom N
DISTINCTDistinct
DISTINCT ONDistinct
JOINJoin or Lookup
LEFT JOINJoin or Lookup
CROSS JOINCross Join
ASOF JOINAs-of Join
ANTI JOINJoin
UNION ALLUnion
UNION BY NAMEUnion
EXCEPTJoin or Compare Tables
PIVOTPivot
UNPIVOTUnpivot
UNNESTExplode or Split to Rows
ROW_NUMBERAdd Row Number or Rank
RANKRank
LAGShift / Lag or Multi-row Formula
SUM() OVERRunning Aggregations or Group Aggregate
QUALIFYFilter or Rank
WITHDuckDB Query
STRING_AGGAggregate
date_truncTruncate Date/Time or Resample
generate_seriesGenerate Series
regexp_extractRegex Extract
read_csv_autoCSV Reader
read_parquetParquet Reader
COPY TOWrite CSV or Write Parquet
CREATE TABLE ASWrite to DB or Write Locra Table
SUMMARIZEDescribe or Column Profile
ST_TransformReproject
ST_IntersectsSpatial Join

pandas and Polars

SQL/pandas nameLocra
read_csvCSV Reader
read_excelExcel Reader
read_htmlWeb Page (Add data source, Web Page)
read_sqlDB Reader or DuckDB Query
read_xmlXML Reader
mergeJoin or Lookup
merge_asofAs-of Join
concatUnion or Zip
aggAggregate
assignAdd Column
with_columnsAdd Column or Multi-field Formula
astypeCast Types
fillnaFill Missing
dropnaFill Missing or Filter
drop_duplicatesDistinct
sort_valuesSort
renameRename
dropSelect Columns or Filter
queryFilter or DuckDB Query
isinFilter
str.containsFilter
str.splitSplit to Columns or Split to Rows
str.replaceText Operations or Replace Values
explodeExplode or Split to Rows
meltUnpivot
pivot_tablePivot or Aggregate
crosstabPivot or Value Counts
cutBin
shiftShift / Lag
pct_changeDiff / Pct Change
cumsumRunning Aggregations
rollingRolling Window
ewmExponential Weighted Mean
resampleResample
value_countsValue Counts or Column Profile
describeDescribe, or the Metadata tab under the canvas
nlargestTop / Bottom N
headRow Limit
to_datetimeParse or Convert Serial Date
applyCode Gen or DuckDB Query
to_parquetWrite Parquet
to_excelWrite Excel
to_sqlWrite to DB
plotChart
sjoinSpatial Join
to_crsReproject

dbt

SQL/pandas nameLocra
refWire an edge from the upstream node instead
sourceDB Reader or CSV Reader
seedCSV Reader or Constant Table
materialized='table'Write to DB
dbt runThe Run button (⌘↵), or Run pipeline in ⌘K
dbt testAssert or Expectations
not_nullAssert or Expectations
uniqueDistinct or Assert
accepted_valuesAssert or Expectations
relationshipsJoin or Assert
recencyAssert or Expectations
unique_combination_of_columnsAssert or Expectations
generate_surrogate_keySurrogate Key or Row Hash
date_spineGenerate Series or Densify
snapshotCompare Tables or Row Hash
dbt Cloud jobDeploy & schedule to cloud (Cloud runs)
dbt docs generateLineage is the canvas itself; see docs per node

No equivalent yet

Some SQL/pandas tools have no Locra node yet. Searching for them shows a hint instead of an empty list. These are the ones you are most likely to miss:

SQL/pandas nameWhat to do instead
MERGE INTOUpsert not supported yet; Write to DB can replace or append
ON CONFLICTUpsert not supported yet; Write to DB can replace or append
GROUPING SETSRun several Aggregate nodes and stack them with Union
ROLLUPAggregate at each level, then Union the results for subtotals
CUBEAggregate per combination, then Union; or write it in DuckDB Query
CREATE MACROPut reusable SQL in a DuckDB Query node
EXPLAINNo query plan view; each node's SQL is visible in its code
cumprodNo cumulative product; use a Multi-row Formula ([Row-1:col] * x)
get_dummiesNo one-hot node yet; Pivot with count, or a DuckDB Query
read_featherConvert to Parquet first; Feather isn't read yet
read_fwfNo fixed-width reader; read lines as CSV then Split to Columns
read_sasSAS files aren't supported; export to CSV first
insert_by_periodLoop over periods and append with Write to DB
get_query_results_as_dictUse the node's output table directly; no Jinja templating

Tips

  1. Search by function name. Typing melt, QUALIFY or merge_asof finds Unpivot, Filter and As-of Join.
  2. Use a query node as a bridge. Paste a query you already trust into a DuckDB Query node to get going, then split it into nodes where seeing each step's output helps.
  3. Read the code a node runs. Select a node and open the Code tab to see its Python. Click the pencil there to edit it, and the node runs your version; Revert to generated code in the Attributes panel brings back the generated code.
  4. Take it to production as a package. Export as Python library gives you a package you can install with pip. Credentials are never written into it: they come from environment variables, listed in an example file next to the package.