Skip to content

Commit 4e11642

Browse files
authored
Tweak the formatting of README
1 parent f6bd872 commit 4e11642

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# dtsl-mysql
2-
Date/Time/Strings Libraries (DTSL) for MySQL
2+
### Date/Time/Strings Library (DTSL) for MySQL
33

44
DTSL is collection of stored functions and procedures for manipulating date, time, and string values, for MySQL, MariaDB, and Percona Server.
55

@@ -15,19 +15,19 @@ This project and its actual code will be published soon.
1515

1616
The rest of this is a draft. Still deciding on how to organize the documentation.
1717

18-
#### Read this, first.
18+
### Read this, first.
1919

2020
I have a deep and abiding sense of irritation reserved for people who are nice enough to share their code but apparently not nice enough to explain how it works and how to use it... so I am determined not to be one of those people.
2121

2222
I will be writing a comprehensive guide to all of the features and capabilities this library provides.
2323

2424
If you "do not have time" to read this entire document carefully, please note that I will also not have time to re-answer any questions already covered, here.
2525

26-
#### Text/String Functions
26+
### Text/String Functions
2727

2828
Sometimes, it's nice to let the database take care of something, even when the database is arguably the "wrong" place to do it.
2929

30-
##### RLIKE is all there is? What about regex_replace?
30+
#### RLIKE is all there is? What about regex_replace?
3131

3232
I solved this one during a boring meeting.
3333

@@ -55,7 +55,7 @@ How about that? For each occurrence of 1 or more characters in [aeiou], we repla
5555

5656
Sorry, no capturing groups (e.g. `\1` or `$1`) support. If you really need regexes that badly, you need to be using something more efficient... but this is a sweet little coup that allow some easy matching and cleanup with replacements.
5757

58-
###### HTML entities in strings in your database?
58+
#### HTML entities in strings in your database?
5959

6060
Maybe it's old static content, who knows how it got that way -- I'm not judging -- but the data, for whatever reason, is now in your database and it's making you crazy. When you send it straight to a web page, sure, it's fine, but when you put it in a report or something -- yuck. You can clean these up, either on demand or en masse, with `decode_entities(longtext)`.
6161

@@ -71,9 +71,9 @@ Maybe it's old static content, who knows how it got that way -- I'm not judging
7171

7272
Tell me that isn't beautiful to behold.
7373

74-
#### Date/Time Handling
74+
### Date/Time Handling
7575

76-
##### Support for particularly useful subsets of iso8601 formatting of datetimes
76+
#### Support for particularly useful subsets of iso8601 formatting of datetimes
7777

7878
MySQL has some excellent built-in date/time manipulation functions and a useful implementation of time zones, including the magic handling of `TIMESTAMP` columns in the current session `@@time_zone` but lacks the ability to accept timestamps you may receive from external APIs and other places.
7979

@@ -114,7 +114,7 @@ Additional formats should be fairly straightforward to implement if needed.
114114

115115
MySQL Server 5.6 introduced millisecond and microsecond datetimes and timestamps, but stored functions don't support dynamic typing, so it's impossible to selectively return a `DATETIME` or a `DATETIME(3)` or a `DATETIME(6)` depending on the particular input parameters. And yet, it's very arguably wrong to implicitly convert '2015-03-23T12:00:00Z' into '2015-03-23 12:00:00.000000' because of the false sense of precision this provides. Future iterations of this function may actually resort to returning a `TINYTEXT` and letting MySQL implicitly cast it it to the appropriate type for your use -- so, for example, if you provide a timestamp with precision to the millisecond, we'll provide a return value with the same three decimals populated.
116116

117-
##### Find the short, common, human-friendly abbreviation of a particular time zone at a particular point in time.
117+
#### Find the short, common, human-friendly abbreviation of a particular time zone at a particular point in time.
118118

119119
This is useful for showing timestamps to humans who are unfamiliar with time zone names like "America/Chicago." Of course, these are the same people who will use the phrase "Eastern Standard Time" in the summer, when it is in fact "Eastern Daylight Time," but we can only solve so many problems at the database level.
120120

@@ -149,7 +149,7 @@ Now, let's see if we can make this do something useful.
149149

150150
Seems legit.
151151

152-
##### Given a date or datetime, find the first day of the [ previous | current | next ] [ week | month | quarter | year ] based on that date.
152+
#### Given a date or datetime, find the first day of the [ previous | current | next ] [ week | month | quarter | year ] based on that date.
153153

154154
Not surprisingly, these functions were actually the original inspiration for collecting similar functions into "dt," which originally stood for "date/time" and later became an internal backronym for "data tools" and finally evolved into "dtsl." Tragically, they are perhaps the least exciting in appearance, despite the fact that they are tremendously useful for creating easy to write, easy to understand, easy to debug, and easy to optimize queries.
155155

@@ -194,7 +194,7 @@ TODO: we have these for year and quarter also.
194194

195195
----
196196

197-
Fix the Y2K bug in the other direction.
197+
#### Fix the Y2K bug in the other direction.
198198

199199
This function is embarrassing. It should be particularly embarrassing to the client that sends me this data -- sometimes it's in mm/dd/yyyy format, and other times it's in mm/dd/yy format -- in the same table, of course -- where it's populated into a column that was explicitly defined by the client as a *text* field. I have to keep it in this hideous form because the client refreshes the data via an API call every time the site visitor logs in... but they expect me to interpret it for reporting.
200200

0 commit comments

Comments
 (0)