Repository navigation
Project commands for 1.0.0: init, profiles, source and connection - #61
Merged
Merged
Conversation
relix init [DIR] writes catalog/, a profiles.json only its owner can read, and a .gitignore inside .relix/ holding profiles.json, so it never edits a file of the user's. -o and -P write a relixrc with those defaults, the profile -P names is defined, empty, so the next run finds it, and --root writes the root marker. It then trusts what it wrote, as catalog trust would, so the first run shows no warning. A directory that already has a .relix/ is refused with exit 2, and outside $HOME it warns that only the working directory's .relix/ is read there. Part of #55.
…oss them relix profiles ls lists profile, variable and file, never a value, and is what a bare relix profiles does. set takes the value from a prompt that does not echo on a terminal, or from stdin otherwise, never from an argument, so it stays out of shell history and ps. get prints the value a run under the profile would resolve, nearest file first. rm removes a variable, or without one the whole profile. set and rm write the nearest project's profiles.json, or ~/.relix's with --user, at 0600, refuse a looser file as reading does, and warn when git tracks it. Any change under a trusted .relix/ untrusts it, so Trust.keep checks, before a command writes, that the directory is trusted and unchanged since; if so it records the new hash after the write, and otherwise the directory stays untrusted, so a change someone else made is still reviewed. The command says which happened. source and connection will write the same way. Part of #56.
…lags
The two nouns mirror the language's two declarations. add takes NAME
KIND|CONNECTION [LOCATION] and every other option of the declaration as a
--OPTION=VALUE flag, or --OPTION for true, and writes one declaration to
catalog/00-source-<name>.relix or 00-connection-<name>.relix, printed as
relix fmt prints it. The text is parsed by the engine before it is
written, so a missing option is the parser's "missing 'url'", reported as
a usage error naming --url. A relative LOCATION is rewritten relative to
the catalog file, which is what it resolves against. A secret is accepted
only as a ${NAME} placeholder. --infer-schema reads a CSV file's heading,
or a table's columns as its database describes them; a JSON source is
schema-on-read and declares no schema, so it is refused there. A name an
outer level declares is allowed and warned about, naming the file it
shadows. --global writes ~/.relix; --user stays free for a connection's
own user option.
ls lists name, kind, location and file. edit sets and --unset options, and
--location moves a file source; --editor opens $VISUAL or $EDITOR at the
declaration's line. rm refuses a name another declaration reads, listing
them, unless --force, and says when a farther declaration now shows
through. edit and rm change only a declaration alone in its file, and
report one beside others with its file and line. source test reads one
row of each source under the profile and checks a declared schema against
what was read; connection test opens each database connection with a
probe of a table no database has. Both exit 5 when one fails.
Every write keeps a trusted project trusted, by the rule profiles uses.
Part of #57.
This was referenced Oct 16, 2026
relix profiles set | get | ls | rm, and keeping a project trusted across the command's own edits
#56
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The three 1.0.0 issues, one commit each.
relix init(#55)Creates a project's
.relix/:catalog/,profiles.jsonat0600, a.gitignoreinside.relix/holdingprofiles.json, plusrelixrcwith-o/-Pand therootmarker with--root. It trusts what it wrote, refuses (exit 2) a directory that already has a.relix/, warns outside$HOME, and writes nothing to stdout.One deviation: with
-P NAME,profiles.jsonis{"NAME": {}}rather than{}. Otherwise therelixrcit writes names a profile nothing defines, and the very next run fails with "no profile".relix profiles ls | set | get | rm, and the trust rule (#56)lslists profile, variable and file, never a value. A barerelix profilesdoes the same.setreads the value from a prompt that does not echo on a terminal, or from stdin otherwise, never from an argument.getprints the value a run under that profile would resolve, nearest file first.rm PROFILE [VARIABLE]removes one variable, or the whole profile.setandrmwrite the nearest project's file, or~/.relix's with--user, at0600. They refuse a looser file and warn when git tracks it.Trust.keepis the rule every writing command follows. A project that is trusted and unchanged since stays trusted across the command's own write. Any other stays untrusted. Which one happened is said on stderr.relix source/relix connection:add | ls | edit | rm | test(#57)addwrites one declaration tocatalog/00-source-<name>.relixor00-connection-<name>.relix, printed byScriptFormatter. That is the engine's canonical one-line form, sorelix fmtleaves it unchanged.--url.LOCATIONis rewritten relative to the catalog file, which is what it resolves against.${NAME}: an option named password, secret, token, key or credential, or a URL carryingpassword=.editandrmchange only a declaration alone in its file. One beside others is reported with its file and line, and--editoropens$VISUAL/$EDITORat that line.rm. It refuses a name another declaration reads, unless--force, and says when a farther declaration now shows through.test.source testreads one row per source under the profile and checks a declared schema against what was read.connection testopens each database connection with a probe of a table no database has: "table not found" means it connected. Both exit 5 when one fails.Three choices worth a look:
--global, not--user, writes~/.relixforsourceandconnection. The issue's own example passes--user='${WAREHOUSE_USER}'as a connection option, so--usercan't also be the scope flag there.profileskeeps--user.--infer-schema. The engine's JSON source is schema-on-read and has noschemaoption, so the flag is refused with exit 2.--infer-schemacovers CSV files, connection tables anddatabasesources.connection testonly opens database connections. Any other kind (a file connection,mongodb) is listed asuntestedafter its placeholders are checked. The engine has no public API to open one.Docs
New command pages (
init,profiles,source,connection), sections incatalog.mdandsecrets.md, anddesign.md§3, §5.1, §5.3 and §5.4. Every new example runs inGuideExamplesTest../gradlew clean buildpasses, and so does each commit on its own.Fixes #55
Fixes #56
Fixes #57