SQL pretty printer for Materialize
Binaries are available for local execution.
https://mz.sqlfum.pt/ is a public site that compiles this crate to wasm. It only needs a static web server (GitHub pages here) and runs entirely in the browser.
SQL pretty printer for Materialize
Home Page: https://mz.sqlfum.pt/
License: MIT License
SQL pretty printer for Materialize
Binaries are available for local execution.
https://mz.sqlfum.pt/ is a public site that compiles this crate to wasm. It only needs a static web server (GitHub pages here) and runs entirely in the browser.
https://github.com/mjibson/mzfmt/actions/runs/7919361445/job/21619951773
Compiling mzfmt v0.2.3 (/github/workspace)
error: linking with `/opt/osxcross/target/bin/x86_64-apple-darwin14-clang` failed: exit status: 1
|
= note: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET LC_ALL="C" PATH="/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/bin:/opt/osxcross/target/bin:/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" ZERO_AR_DATE="1" "/opt/osxcross/target/bin/x86_64-apple-darwin14-clang" "-arch" "x86_64" "-m64" "/tmp/rustcuRw29u/symbols.o" "/github/workspace/./target/x86_64-apple-darwin/release/deps/mzfmt-c2080ca5e8ee7e49.mzfmt.2c82a2da94509c53-cgu.0.rcgu.o" "/github/workspace/./target/
...
ld: warning: object file (/github/workspace/target/x86_64-apple-darwin/release/deps/libregex_syntax-98337405bcd5a470.rlib(regex_syntax-98337405bcd5a470.regex_syntax.60778c56f295029b-cgu.04.rcgu.o)) was built for newer macOS version (10.12) than being linked (10.8)
Undefined symbols for architecture x86_64:
"_getentropy", referenced from:
std::sys::unix::rand::hashmap_random_keys::ha92d0a2687c22b7a in libstd-4b3c9502f998a9c9.rlib(std-4b3c9502f998a9c9.std.ccb858c55971878c-cgu.0.rcgu.o)
ld: symbol(s) not found for architecture x86_64
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
error: could not compile `mzfmt` (bin "mzfmt") due to 1 previous error
No idea what's going on here. I looked around and couldn't find anything obvious. Maybe something to do with the github actions builder or the rust version used in something.
Looked into this but not sure why it's happening because there's a line()
in there.
select 1,2, blag('a', 'b')
SELECT id, ts, status FROM (SELECT id, ts, status, LAG(status) OVER (PARTITION BY id ORDER BY ts) AS last_status FROM t) t WHERE status != last_status OR last_status IS NULL;
SELECT id, ts, status
FROM
(
SELECT
id,
ts,
status,
lag(status) OVER (PARTITION BY id ORDER BY ts)
AS last_status
FROM t
)
AS t
WHERE
status
<> last_status
OR
last_status
IS
NULL;
Probably need to teach SELECT to de-indent things? This query looks pretty good on the cockroach site.
not sure how these started. a reload appeared to fix it.
WITH
cities (city, state, pop) AS
(
SELECT city, state, pop
FROM
(
VALUES
('Los_Angeles', 'CA', 3979576),
('Phoenix', 'AZ', 1680992),
('Houston', 'TX', 2320268),
('San_Diego', 'CA', 1423851),
('San_Francisco', 'CA', 881549),
('New_York', 'NY', 8336817),
('Dallas', 'TX', 1343573),
('San_Antonio', 'TX', 1547253),
('San_Jose', 'CA', 1021795),
('Chicago', 'IL', 2695598),
('Austin', 'TX', 978908)
)
AS cities (city, state, pop)
)
SELECT state, city
FROM
(SELECT DISTINCT state FROM cities) AS states (state),
LATERAL (SELECT city FROM cities WHERE state = states.state ORDER BY pop DESC LIMIT 3) AS subquery
ORDER BY state, city;
SELECT
title,
array_agg(first_name || ' ' || last_name ORDER BY last_name)
AS actors
FROM film
GROUP BY title;
for example is weird because the select args are nested, but the from and group by aren't. Make this consistent. Probably need to remove some inner groups?
SELECT
origins.id,
(
SELECT count(*)
FROM events
WHERE
(
(payload ->> 'foo_865' = '843' OR payload ->> 'bar_449' = '658' OR payload ->> 'qux_600' = '583') AND mz_logical_timestamp() BETWEEN (1000 * date_part('epoch', timestamp_col)::numeric) AND (1000 * date_part('epoch', timestamp_col + INTERVAL '30 days')::numeric) AND category_id = origins.category_id AND origin_id = origins.id
)
)
AS foo__m4__count_30_days,
(
SELECT max(timestamp_col)
FROM events
WHERE
(
(payload ->> 'foo_573' = '43' OR payload ->> 'bar_727' = '631' OR payload ->> 'qux_976' = '262') AND category_id = origins.category_id AND origin_id = origins.id
)
)
AS foo__m19__max_time
FROM
origins
JOIN
categories
ON categories.id = origins.category_id
WHERE categories.type = 'foo';
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.