<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Graham Sutton</title>
    <description>The latest articles on DEV Community by Graham Sutton (@grahamsutton).</description>
    <link>https://dev.to/grahamsutton</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F174773%2Fd15cb9dc-19a7-48ec-a8d1-60286c857e69.jpeg</url>
      <title>DEV Community: Graham Sutton</title>
      <link>https://dev.to/grahamsutton</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/grahamsutton"/>
    <language>en</language>
    <item>
      <title>Raw SQL Migrations Library</title>
      <dc:creator>Graham Sutton</dc:creator>
      <pubDate>Fri, 13 Sep 2019 21:38:14 +0000</pubDate>
      <link>https://dev.to/grahamsutton/raw-sql-migrations-library-3a1h</link>
      <guid>https://dev.to/grahamsutton/raw-sql-migrations-library-3a1h</guid>
      <description>&lt;p&gt;Where I currently work, we operate on a stack of mostly PHP and PostgreSQL. Our framework was written in ZF1 (it's legacy), and our deployment process for keeping our database changes version-controlled is quite tedious and complex.&lt;/p&gt;

&lt;p&gt;Outside of work, I love using frameworks like Laravel and Rails and one of the features I really love from both of these is migrations. Since our legacy application at work doesn't have this concept, I started thinking of ways to take this modern approach and apply it to our legacy app.&lt;/p&gt;

&lt;p&gt;Since we cannot convert our entire application over to one of these frameworks (it would be a major overhaul), I looked into some options like Phinx and Flyway for possible integration, but these options were not really compatible with our app (for various reasons that would deserve their own post).&lt;/p&gt;

&lt;p&gt;At our company, we make very heavy use of PostgreSQL: complex procedures, triggers, views, multiple schemas, data warehousing, etc... we power everything on it. Many migration-type libraries usually have some abstraction layer that doesn't really support the full range of these database features. For example, Rails migrations are written in Ruby and then converted down to SQL before execution; same with Laravel and PHP. This isn't a bad thing, but these types of abstractions don't truly support the wide range of database features (particularly procedures) and are typically limited to just creating tables, indexes, and constraints.&lt;/p&gt;

&lt;p&gt;So, I decided to task myself (for fun mostly) with trying to build a migrations library that would run on raw SQL, and lo and behold, I actually got a simple concept going! The underlying CLI is written in PHP, but you write and execute migrations in raw SQL.&lt;/p&gt;

&lt;p&gt;I figured that maybe a lot of other people could get some use from such a library, and so I put it up on GitHub a while back but never really shared its existence with anyone. So today, that is what I am doing.&lt;/p&gt;

&lt;p&gt;I am really looking for people who would like to help make it better. I think it's a good start, but I know a truly great tool isn't built by one person alone. Feel free to criticize, praise, or contribute!&lt;/p&gt;

&lt;p&gt;Exodus Migrations Library: &lt;a href="https://github.com/grahamsutton/exodus"&gt;https://github.com/grahamsutton/exodus&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>sql</category>
      <category>database</category>
    </item>
    <item>
      <title>Laravel's factory method, but for JavaScript.</title>
      <dc:creator>Graham Sutton</dc:creator>
      <pubDate>Sun, 02 Jun 2019 14:40:08 +0000</pubDate>
      <link>https://dev.to/grahamsutton/laravel-s-factory-method-but-for-javascript-1o3a</link>
      <guid>https://dev.to/grahamsutton/laravel-s-factory-method-but-for-javascript-1o3a</guid>
      <description>&lt;p&gt;When I became exhausted with trying to create tons of mock API data on the fly for my Node projects, I created a simple little script that would let me define the skeleton of the JSON structure I wanted without having to copy, paste, and modify each individual record.&lt;/p&gt;

&lt;p&gt;This script is now available as an NPM package that does almost exactly what Laravel's factory method does except for JavaScript. It's lightweight and great for stubbing APIs in your Vue and React projects, too!&lt;/p&gt;

&lt;p&gt;Link to the repo: &lt;a href="https://github.com/grahamsutton/factory"&gt;https://github.com/grahamsutton/factory&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>vue</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
