datajoint/datajoint-matlab

Add non-interactive options for interactive tools like `dj.new` and `dj.createSchema`

Closed this issue · 2 comments

Interactive tools like dj.new and dj.createSchema offers convenient ways of creating new schemas/tables. However, there are no non-interactive equivalent to these tools such that there is no way to create schema/table (easily) from a non-attended script. It would perhaps be nice to either offer non-interactive modes to these functions or come up with non-interactive alternatives all together.

This may just take the form of arguments passed into these functions. Without input, they become interactive.

This would have been far cleaner to implement if Matlab function had a (clean) way to implement default values. I'm thinking that createSchema can expect two arguments - database name and package path. Just like how I modified the current version, I would like to be able to pass in just the name of the package to trigger GUI to choose a folder to create the package in (this is convenient when triggering createSchema from dj.new. I'm not sure what would be the cleanest way to do this yet.

dj.new can expect to take in two arguments as well - name of table (schema.table) and the type of the table. I'm thinking that if the type of the table is not specified then it will automatically use Manual table. If name of table was passed into dj.new but the schema doesn't exist, then we should just throw an error rather than triggering dj.createSchema.