Settings for query editor

Is there a settings for query editor?, like;

  • tab size
  • font size

These aren’t exposed in the UI. But you can modify them here and then rebuild your frontend assets for them to take effect. Just add your settings to editorProps. The complete list of configuration options is here.

Thanks,
I’ am trying to implement settings for query editor, which should be per user basis.
But i could not find any place to store settings per user.
There is organization settings but this will affect all users in the organization .

Any suggestion on this ?

You’re correct that the admin settings are for the entire org. If you need to store by user then you can add a key to the users.details field in the database. It’s a JSON field so you can add new data to it without modifying the database schema.

Not a suggestion but a thought: what happens if a viewer’s tab settings differ from the creator of a query? Which one should be sent to the database? What if two users edit the same query? Will the tabs be heterogenous?

I’d recommend splitting the setting so that it sticks with the query instead of the user.

Also, you might check with this forum user who implemented the same behavior:

Thank’s I’ve searched similar questions
and seen this one an up-voted that post before :slight_smile:

I saw the details field but i thought it’s reserved for other things, but i’ll check and try if i can embed settings here.

My thoughts in general;

Editor has a central role in redash, so if i we have options to customize, it will be great. I’ve played with
ace, code mirror and monaco before. Liked monaco most. It’s been discussed here also but i’ll not open that now.

So, for your concerns about tab sizing; Supposing;

We have user based editor settings
We have two users; user A with tab settings 2 spacing and user B with tabs 4 spacing
Both users A and B uses spaces instead of tabs (supposing we have this setting too)
User A created a query Q and saved it;
User B opened Q, will see two spacing (because user A uses spaces instead of tabs)
User B edits and saves the query then the query will have mixed spacing.
I guess this case is inevitable.

I’ve several questions;

  • If we keep the settings per query basis, then user B will be forced to use 2 spacing am i right ?
  • So we must have two settings both for query and for user ? (so user will not have to change the settings for each query)
  • Where can we put this settings in ui, there is a profile section for user but i am not sure if it’s a good place.
  • I haven’t look at the queries table yet, is there a field like settings, or details like users or organizations table ? (edit: there is ‘options’ field)

Thanks.

how about something like this ?