Causal command line compiler for FDL files.
Causal replaces your session tracking, feature management, and A/B testing tools into one integrated system so you can focus on your competitive advantage, not building robust data pipelines.
Full Documentation available at docs.causallabs.io
bash
npm install --save-dev @causal/compiler
`If you have a non-node project you can use the following command when you need to run the compiler:
`bash
npx @causal/compiler
`Usage
After updating your FDL file, you can run the compiler to generate the appropriate code for your project. The compiler will generate a file for each platform you have enabled using the appropriate command line flag.For example, to generate a typescript client for your project, you can run the following command:
`bash
npx @causal/compiler --push-fdl --typescript {your/project/path/components/}causal.ts fdl/causal.fdl
`Command Line Flags
--compiler-classpathWhere the Java system compiler gets the Causal runtime and dependencies when compiling FDL java classes. Default is to use the current classpath, which is correct in most situations. Same format as the -cp option to javac. You should not need to change this unless you are launching the compiler in a non-standard way, for example from a Spring application.
Default: $CLASSPATH (or %CLASSPATH% on Windows)
--deleteWhen using --partial. In addition to replacing the specified files, delete this file. May be used more than once on the command line.
Default: []
--environmentThe environment for which we are generating code.
Default: Production
--force-requeryForce grabbing data from tools.causallabs.io. Die if we cannot connect.
Default: false
--helpPrint command line documentation
Default: false
--hiveFile to write Hive warehouse ddl file. Will emit Hive statements, unless --redshift-schema is specified, in which case redshift DDL is emitted
Default: Not provided
--javaDirectory to write java code. Default is not to emit java.
Default: Not provided
--kotlinDirectory to write kotlin code for the Android client. Default is not to emit kotlin.
Default: Not provided
--no-compatibility-checkDo not check if the current control values are incompatible with the FDL file. Setting this to true will allow you to compile FDL files that are not compatible with your current production configuration, potentially breaking your production environment
Default: false
--no-control-check
Only warn if the current control values are incompatible with the FDL file. Default is a compile error.Default: false
--number-of-days-of-partitionsThis parameter controls the number of days to look back for partitions when generating DDL statements to define the data warehouse.
Default: 14
--partialAdd (or replace) the given files with those that have already been pushed to Causal. This allows you to compile a subset of files for your project, leaving everything else in place. The files you specify will be added or replace the server-side files, which are stored locally in the .causal/fdl directory. Can be combined with --push-fdl to do the same on the server. See partial compilation.
Default: false
--push-fdlPush the fdl code to the tools endpoint after compiling succeeds.
Default: false
--redshiftFile to write Redshift warehouse ddl file. Will emit Redshift PSQL statements. You must also specify --redshift-schema.
Default: Not provided
--redshift-schemaDefines the redshift external schema in which we should generate Causal external tables.
Default: Not provided
--rubyFile to write ruby API code. Default is not to emit ruby.
Default: Not provided
--snowflakeFile to write Snowflake warehouse ddl file. Will emit snowsql statements.
Default: Not provided
--swiftDirectory to write swift code for the iOS client. Default is not to emit swift.
Default: Not provided
--kotlin
Directory to write kotlin code for the Android client. Default is not to emit kotlin.Default: Not provided
--templateExpand a user supplied mustache template file. The API available to the mustache template is defined in the io.causallabs.mustache.Context class.
Default: Not provided
--template-outWhere a user supplies mustache template is expanded into.
Default: Standard out
--template-paramsName of json file to feed to the template in the 'params' context. The file should contain a single JSON object, and the object's fields are available as top level variables in the template.
Default: Not provided
--tokenThe authorization token with which to access data on Causal.
Default: Not provided
--ts-react-splitEXPERIMENTAL: Intend for use with react server components. Write three typescript files, a base file, one for server components, and one for client components. The provided name is the base name and the server and client files will be suffixed with .server.ts and .client.ts
Default: false
--typescriptWrite the typescript module to the given file.
Default: Not provided
--versionPrint the compiler version and exit.
Default: false
--warnOnly warn on warehouse compatibility checks, do not error out. Default is to error out. Using this setting in production can break your warehouse.
Default: false
--warn-on-error`Only warn on warn on compatibility checks, do not error out. Default will error when compatability fails in a staging environment for an entity in use in a production environment.
Default: false