Columns and types

Every column has a type, which decides what it can hold, how it sorts and displays, and which filters apply to it. You pick a type for a new column, Mycorr infers one for imported data, and a cast converts a column to another type without touching the original.

The types

These are the types the column type picker offers, by the names the app shows in column headers.

TypeHoldsNotes
NumberIntegers and decimalsChoose Approximate or Exact precision. Advanced sets the width, such as Int32 or Float64
TextAny stringCan display as plain text or as clickable links
BooleanTrue or false
Date & timeA moment, stored in UTCPrecision in seconds (the default), microseconds or nanoseconds
DateA calendar date with no time
DurationA length of timeDisplayed in a unit you choose
SelectOne or several labels from a set you defineSee Select columns
ListSeveral text values in one cell
JSONA structured value
UUIDAn identifier
AttachmentFiles on the rowOne per table. See Attachments

At the top of the picker, ƒ Formula makes a column computed from other columns instead of typed in. See Formulas.

Number precision

The two precisions decide what happens when a value with decimals lands in a column of whole numbers:

  • Approximate is for measurements and averages. A decimal widens the column to a floating-point number.
  • Exact is for money, IDs and counts. A decimal widens the column to an exact decimal, so no precision is ever lost.

An exact decimal column keeps its precision and scale (for example, ten digits with two after the point) as part of its type. How many decimals are shown is a display setting, and changing it never changes what is stored.

Set a column's type

A new, empty column has no type until it gets one:

  1. Select the column's header.
  2. Click Set Data Type on the action bar.
  3. Pick a type. Open Advanced for numeric widths.

You can also start typing values. The column takes the type of what you enter.

Imported data arrives typed. An upload or a paste infers each column's type from its values, and falls back to Text for anything that doesn't parse consistently as something narrower, because text is lossless and can always be cast later. Tables from a connection carry the types the source declares.

Locked and unlocked

Each typed column is either Unlocked or Locked. Switch it with Lock data type and Unlock data type on the column.

ModeWhen a value doesn't fit the type
UnlockedThe type can widen to fit. Before the change is saved, Mycorr asks: Change "Price" to Text?, with Change to Text or Keep as Number
LockedThe type is enforced. A value that doesn't fit is marked as a conflict and can't be committed as it stands

Lock a column once its type is settled, so a stray value can't change it for everyone. See Edits and commits for how staged changes and conflicts are resolved.

An Attachment column is always locked.

Cast a column to another type

To convert a column that already holds data, use Cast Column. A cast never rewrites the column in place: it adds a new column with the converted values, and the original stays until you delete it. That way a cast that went wrong costs nothing.

  1. Select the column's header.
  2. Choose Cast Column.
  3. Pick the target type and give the new column a name.
  4. Choose a Cast Mode:
    • Best Effort converts what it can and leaves an empty cell where a value can't be converted.
    • Strict fails if any value can't be converted exactly, and changes nothing.
  5. Click Cast.

Cast Column isn't offered on a locked column; unlock it first.

Which casts are possible

Mycorr decides how safe a cast is before you pick it:

What it means
SafeAlways works on well-formed data, such as a 32-bit integer to a 64-bit one
LossyOffered, marked May lose data. It may empty the cells it can't convert, such as text to number, or a wide number to a narrower one
DisallowedNot offered at all, so you can't pick one by mistake

A few rules worth knowing:

  • Text is the universal fallback. Almost every type casts to text.
  • Number to Boolean is lossy: 0 becomes false, anything else true.
  • Boolean casts only to a number or to text.
  • Select casts only to text, which joins a multi-select's labels with commas, or to a list, which keeps them separate.
  • JSON casts only to text or a list, and only text or a list casts to JSON.
  • Attachment never casts. A cast would turn its files into text and silently detach every one of them.

Conversions with no meaning, such as a boolean to a date, are disallowed rather than left to fail cell by cell.

Display formats

How a column looks is separate from what it holds. Display Format (for dates, Display) changes the presentation for everyone, without changing the data:

TypeOptions
NumberNumber Format, and decimals shown Auto or Fixed
Date & timeDate format, and the time zone to show it in. Default (UTC) shows the stored value
DurationDisplay unit
TextShow the raw text, or render values as clickable links (http, https and mailto only)

With a single cell selected, the same action reads Display Format for column and applies to that cell's column.

Delete and restore a column

Delete from Table removes a column softly. It stays in the details pane's Columns list, marked deleted (the section's show deleted / hide deleted toggle shows or hides it), and Restore in its ⋮ menu brings it back with its values. If formula columns depend on it, Mycorr lists them first, because they go with it; restore the column before restoring them.