Skip to content

rdeckj/table-name-minifier

Repository files navigation

table-name-minifier

A Clojure application designed to shorten SQL table names.

Installation

  1. Download the latest release
  2. Unzip the release folder, it contains the tnmin bash script, tmin.jar and .abbreviations
  3. Place them in the same directory somewhere in your $PATH
  4. Run it

Usage

A quick TLDR:

$ tnmin long_table_name_that_should_become_minified        # lng_tbl_nm_tht_shld_bcm_mnfd
$ tnmin short_table_name                                   # short_table_name
$ tnmin pound_remains_special_in_long_names                # lb_rmns_spcl_n_lng_nms
$ tnmin pound_is_special                                   # lb_is_special
$ tnmin --max 10 pound_is_special                          # lb_s_spcl
$ tnmin --max 10 --noabbr pound_is_special                 # pnd_s_spcl

Commands

--noabbr

Ignore the .abbreviations file when minifying the table name. Words that would normally be substituted for abbreviations are minified like all other words.

--max <number>

Set the maximum length of the table name. Input over this length will be minified. Words that can be substituted for abbreviations are still replaced even if the input is under the specified length.

--help

Print the help screen.

Configuration

tnmin ships with an .abbreviations file that is pre-configured with common word/abbreviation pairs. Users can modify this list as needed. Each pair should be on a seperate line, lines can be commented by putting a # character in the first column.

For example:

...
geometry,geom
government,govt
# Months
january,jan
february,feb
...

License

Copyright © 2019 Joshua Radecki

Distributed under the Eclipse Public License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages