Memory leak problems aside (wtf is `MaxListenersExceededWarning` ???), I think I got the `date-streaks` package to work....ish? I'm getting a response from my API client, but not the right response though. Node.js is just so haaaard....
Just sent payment for $90 for standard feature ad for Keto Haus
Day 695 - Nutty November https://writelier.com/nutty-november-fcf5f977-c3ec-4e60-b83a-0ccfd8edca7d
Tried to install npm date-streaks but didn't work, and ended up getting warnings when restarting Strapi server `MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 unpipe listeners added to [WriteStream]. Use emitter.setMaxListeners() to increase limit` - this is too hard π©π©π©
Day 694 - Opportune October wrap-up https://writelier.com/opportune-october-wrap-up-de05d90b-763c-40d6-b6dc-dadebf159a39
Switched my Strapi local db from sqlite to postgres, lost my local placeholder data but no biggie. Configuring databases always stresses me out...Hoping nothing goes wrong when I merge with master on Herokuπ€π
Day 693 - Being selectively ignorant https://writelier.com/being-selectively-ignorant-0983a917-32cb-4e88-82a8-de84edb9f6da
Renewed business registration with ACRA
π₯π₯π₯ππ₯π₯π₯ WOOHOO! FUCK YEAH!!! completed! My proudest streak ever! Day 692 - https://writelier.com/100-days-of-code-8a5b196b-a9b3-442d-bc0e-04e431438318
Managed to make raw sqlite db query in Strapi! Added a new streak route and a controller method using `strapi.connections.default.raw("SELECT author, strftime('%d-%m-%Y %H:%M:%f', published_at/1000.0, 'unixepoch') FROM posts ORDER BY author DESC");` Had to wrangle with epoch time (wut is this!?) vs unix timestamp! π€ͺ Not completely there yet but at least now I can query the `author` and `published_at` dates and see the output on my api client. Next steps - install date-streaks package and integrate it to calculate streaks, figure out how to query in production db since its Postgres π©
Dy 691 - Zoom is wonderful for introverts https://writelier.com/zoom-is-wonderful-for-introverts-7120182d-ef9e-4538-bf58-e5739e51070a
π Current mountain to overcome: how to calculate consecutive day streak in using either strapi.query or SQL query in postgres db. Read up on custom queries in Strapi docs, SQL query on calculating length of a series, MongoDB aggregate functions... brain overloadπ€ͺ
Day 690 - Nine criteria for deciding on whether to take on a project
Created my first test custom query on Strapi! OK seems simple enough... next: a custom query for production, for real
Jason Leow
Author
@scriptifyjs I'm using Postgres for db instead, so I should look at this instead ? https://www.postgresql.org/docs/9.5/tutorial-agg.html
I've used to build Node.js REST and GQL for quite some time now, and Strapi offers a very good tradeoff between flexibility and out-of-the box functionalities, perfect for smaller projects. Only heard good things about Rails, never tried it myself, I grew up in the Node.js land π