<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Hide in my shell</title>
    <description>Mostly photos, some techy posts.</description>
    <link>http://koles.hu/</link>
    <atom:link href="http://koles.hu/feed.xml" rel="self" type="application/rss+xml" />
    <pubDate>Thu, 21 Sep 2023 07:46:52 +0000</pubDate>
    <lastBuildDate>Thu, 21 Sep 2023 07:46:52 +0000</lastBuildDate>
    <generator>Jekyll v3.9.3</generator>
    
      <item>
        <title>A Slick intro to functional mapping of relational databases</title>
        <description>&lt;p&gt;When I planned backend applications and I highlighted the key elements of them I used words like flexibility, speed, scalability and platform-independence. But the last one of these was always a lie in many ways.&lt;/p&gt;

&lt;p&gt;Now I would like to focus on the database part and especially the relational database systems. QUESTION: If you have ever released an application, how many times have you swapped the underlying database software to a different one?&lt;/p&gt;

&lt;p&gt;There are many relational database management systems (RDBMS) out there: Oracle, MySQL, Microsoft SQL, PostgreSQL, SQLite, etc… They are different in many ways, but not on these criteria: well structured datastores with fast data access via the structured query language (SQL). We can argue about which software could be the best fit for your application, but those debates are mostly about licenses or resource requirements and less likely about “can I model the data structure in it” or “can I query the data with the SQL dialect it supports” because the answer in almost all cases is yes.&lt;/p&gt;

&lt;p&gt;Let’s check the data structure you can define in an RDBMS. It is relational! It means you can extract (normalize) some parts of the data you want to store into different tables. Tables are defining the categories of the data you want to store. The relation between these tables gives the real power of the RDBMS. You can define one-to-one, one-to-many and many-to-many relations. (example: A person’s occupation level could be “elementary”, “high” or “university”, so we have two tables “occupation” and “person”, so the relation between them is one-to-many, as one occupation record (“university”) could be connected to many person records.) This is the concept, but how the various RDBMSes implement it are quite different. That is why some of them are ideal for mobile apps (SQLite), while others are good for high-reliability bank systems.&lt;/p&gt;

&lt;p&gt;The other main feature of the RDBMS is SQL. It is a high-level language responsible for defining the data structures, then inserting, updating, deleting and querying data from it. SQL has many complex functions and capabilities which makes it a versatile and powerful tool for many use-cases. But there are many dialects of it, some are vendor specific ones and some are just generic extensions of an older standard. It was introduced in 1974, it has at least 10 standard versions based on &lt;a href=&quot;https://en.wikipedia.org/wiki/SQL&quot;&gt;Wikipedia&lt;/a&gt;. The result of this long lifespan and the many influences from various vendors is that you can easily find yourself in a situation that some of the SQL commands you wrote for MySQL won’t work in PostgreSQL.&lt;/p&gt;

&lt;p&gt;As you can see the main concept behind all RDBMS is the same: a relational database queried by a kinda standardized language. SQL is the high-level interface between the RDBMS and the application you are developing.&lt;/p&gt;

&lt;h2 id=&quot;what-about-the-data-you-ask-via-sql-and-your-rdbms-gives-back&quot;&gt;What about the data you ask via SQL and your RDBMS gives back?&lt;/h2&gt;

&lt;p&gt;This is the tricky part. In general, the result of a query would always be a list of records. The way you will parse it is your decision, ideally. In most of the cases let’s say that decision was made by others who created some “relational to something else” mapping library you chose to use in your application.&lt;/p&gt;

&lt;p&gt;For some reason, which is out of the scope of this article, the creators of those libraries adapt the object-relational-mapping idea (&lt;a href=&quot;https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping&quot;&gt;ORM&lt;/a&gt;). You might have heard some of them: &lt;a href=&quot;https://en.wikipedia.org/wiki/Hibernate_%28framework%29&quot;&gt;Hybernate&lt;/a&gt;, &lt;a href=&quot;https://en.wikipedia.org/wiki/Doctrine_(PHP)&quot;&gt;Doctrine&lt;/a&gt; and of course &lt;a href=&quot;https://en.wikipedia.org/wiki/Django_(web_framework)&quot;&gt;Django&lt;/a&gt; itself has its own, non-replaceable implementation. ORM tries to help translating the relational data structures to objects. In many programming languages you can deal with objects much easier than a list of records. For example the above example could fit into an ORM model well. I can easily define a Person and an Occupation class and when I get back a list of person-occupation records from the DB the ORM can parse them to a list of these objects. As a convenience, I can get the occupation table fields from the person object’s occupation property as an Occupation type object. Sounds easy, doesn’t it?&lt;/p&gt;

&lt;h2 id=&quot;what-is-wrong-with-this-approach&quot;&gt;What is wrong with this approach?&lt;/h2&gt;

&lt;p&gt;Object oriented and relational models differ in the following concepts. (&lt;a href=&quot;https://scala-slick.org/talks/2014-06-09_33rd_Degree/Functional%20Relational%20Mapping%20with%20Slick.pdf&quot;&gt;from Stefan Ziegler - Typesafe&lt;/a&gt;)&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Object Oriented&lt;/th&gt;
      &lt;th&gt;Relational&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Identity&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;NO&lt;/strong&gt; Identity&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;State&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;TRANSACTIONAL&lt;/strong&gt; State&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Behavior&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;NO&lt;/strong&gt; Behavior&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Encapsulation&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;NO&lt;/strong&gt; Encapsulation&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Also ORMs are trying to hide the underlying RDBMS in many ways.&lt;/p&gt;

&lt;h3 id=&quot;hiding-the-real-relations-between-tables&quot;&gt;Hiding the real relations between tables&lt;/h3&gt;

&lt;p&gt;The well defined data structures are transformed into objects using object oriented programming constraints. For example, you can map the one-to-one and one-to-many relations quite easily, but it is cumbersome to express the many-to-many though.&lt;/p&gt;

&lt;h3 id=&quot;sql-becomes-a-low-levelhidden-interface&quot;&gt;SQL becomes a low-level/hidden interface&lt;/h3&gt;

&lt;p&gt;As I stated earlier, SQL is a high-level query language, capable of doing many complex transformations on the data. Degrading it to a low-level interface and sealing it in a proprietary query language defined by the ORM could create many headaches or false assumptions about the performance or versatility of the underlying RDBMS.
When a service grows in the amount of stored data and its complexity, you might find that the DB becomes the bottleneck. To overcome this issue you have to understand what query the ORM creates, so at the end you have to see and optimize these queries too.&lt;/p&gt;

&lt;h3 id=&quot;orm-mixes-your-business-logic-with-db-operations&quot;&gt;ORM mixes your business logic with DB operations&lt;/h3&gt;

&lt;p&gt;As the SQL is hidden and the DB structure is more-or-less described in an object-model the business logic can be written in the ORM layer of your application and if you are not careful the separation of concerns could be mixed easily.&lt;/p&gt;

&lt;h2 id=&quot;how-to-do-this-a-bit-better&quot;&gt;How to do this a bit better?&lt;/h2&gt;

&lt;p&gt;Let’s check what you really need from the DB and if that could come right out of it.&lt;/p&gt;

&lt;h3 id=&quot;rdbms-should-be-a-first-class-citizen-in-your-application&quot;&gt;RDBMS should be a first class citizen in your application&lt;/h3&gt;

&lt;p&gt;First of all if you treat your RDBMS as a first class citizen and you don’t want to hide it, but use its SQL dialect as an API to access the data stored in it, you’ve just simplified your application with at least one layer.&lt;/p&gt;

&lt;p&gt;This way you can focus on how to leverage its benefits, like using native JSON fields, full-text search or audit logs via triggers in MySQL.&lt;/p&gt;

&lt;h3 id=&quot;use-a-more-lightweight-layer-to-transform-your-data&quot;&gt;Use a more lightweight layer to transform your data.&lt;/h3&gt;

&lt;p&gt;What you really need is a simple, descriptive and transparent representation of the data in your programming language.&lt;/p&gt;

&lt;h4 id=&quot;types&quot;&gt;Types&lt;/h4&gt;

&lt;p&gt;If you look at all the RDBMSes they all define strict types for every column, hence we can say they are kinda typesafe. It is not complicated to define the map from these types to the ones your programming language provides.&lt;/p&gt;

&lt;h4 id=&quot;relations&quot;&gt;Relations&lt;/h4&gt;

&lt;p&gt;This is tricky, as with OOP languages it is harder to work with complex structures, lists or streams  seamlessly. Relations are handled in the RDBMS, so what you have to deal with is how you can get the  data in the result. The trick is that you’ll get a flat list of records with fields you asked in the query, so what you really need to do is map the fields into structures you define in your application. In functional programming you can leverage on the map and flatmap and other functions to extract the fields you need quite easily. At the end, you will have your data in pure data objects and you can run functions on them for further transformation in contrast to the OOP way where your objects should contain the methods and the data too.&lt;/p&gt;

&lt;h4 id=&quot;queries&quot;&gt;Queries&lt;/h4&gt;

&lt;p&gt;Use SQL to ask for data, then transform the DB types to your programming language ones and transform this native data structure to your data objects. Sounds functional, doesn’t it?&lt;/p&gt;

&lt;h3 id=&quot;functional-relational-mapping&quot;&gt;Functional-relational mapping&lt;/h3&gt;

&lt;p&gt;Yes we are here finally, the gist of this article. But wait there is no such thing as functional-relational mapping, at least Wikipedia does not have an article about it. But what I wrote about the more lightweight layer basically describes the concept.&lt;/p&gt;

&lt;p&gt;For me this is more like an approach to how you would like to interact with your database. And yes, this could only work with functional languages as I described earlier.&lt;/p&gt;

&lt;p&gt;Let’s check some libraries, first let me quote &lt;a href=&quot;https://playframework.github.io/anorm/&quot;&gt;Anorm&lt;/a&gt;: “Anorm […] uses plain SQL to interact with the database and provides an API to parse and transform the resulting datasets.” Anorm is somewhat a bare-bone FRM tool, despite it does not use that term. Anorm does not define any SQL like query language on top of the chosen RDBMS’s SQL, but helps you to work with the data you got from the DB.&lt;/p&gt;

&lt;p&gt;Here is an example:&lt;/p&gt;

&lt;div class=&quot;language-scala highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;anorm.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Macro&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;RowParser&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;SqlStringInterpolation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;java.sql.Connection&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;DatabaseDefinitions&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;implicit&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Connection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;// pure typesafe data classes aka structures&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Occupation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Person&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;age&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;occupation&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Occupation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;// nested parser&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;implicit&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;occupationParser&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;RowParser&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Occupation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;Macro&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;parser&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Occupation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;](&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;occupation_id&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;occupation_name&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;personOccupation&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;RowParser&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Person&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;Macro&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;namedParser&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Person&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;getBela&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Person&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
    &lt;span class=&quot;nc&quot;&gt;SQL&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&quot;&quot;SELECT
            p.name, p.age,
            o.id as occupation_id, o.name as occupation_name
          FROM person p JOIN occupation o ON p.occupation_id=o.id WHERE f.name=${&quot;Bela&quot;}
          &quot;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;personOccupation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;single&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;if-this-is-a-norm-then-how-more-slick-it-could-be&quot;&gt;If this is “a norm” then how more “slick” it could be?&lt;/h4&gt;

&lt;p&gt;&lt;a href=&quot;https://scala-slick.org/&quot;&gt;Slick&lt;/a&gt; defines itself as a function-relational mapping library with all the bells and whistles. Sometimes too much of them.&lt;/p&gt;

&lt;p&gt;On top of Anorm slick has its own DSL written in Scala, so you can write your “database queries in Scala instead of SQL, thus profiting from the static checking, compile-time safety and compositionality of Scala. Slick features an extensible query compiler which can generate code for different backends.”&lt;/p&gt;

&lt;p&gt;Is it bad then, as it hides SQL and most of the RDBMS?&lt;/p&gt;

&lt;p&gt;Let me be more clear: it can hide them, but it also gives you the tools to use it similarly to Anorm, giving you all the benefits of Scala if you need to sit closer to the engine. Let’s see the above example written in Slick:&lt;/p&gt;

&lt;div class=&quot;language-scala highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;slick.basic.DatabaseConfig&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;slick.jdbc.JdbcProfile&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;slick.lifted.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;ForeignKeyQuery&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ProvenShape&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;scala.concurrent.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;ExecutionContext&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Future&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;trait&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;DatabaseDefinitions&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;profile&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;slick.jdbc.JdbcProfile&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;profile.api._&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;// pure typesafe data classes aka structures&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Occupation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Person&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;age&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;occupationId&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;OccupationTable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Tag&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Table&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Occupation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;](&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;occupation&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Rep&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;](&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;O&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;PrimaryKey&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;O&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;AutoInc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Rep&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;](&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;ProvenShape&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Occupation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;mapTo&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Occupation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;lazy&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;occupations&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;TableQuery&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tag&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;OccupationTable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;))&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;PersonTable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Tag&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Table&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Person&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;](&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;person&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Rep&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;](&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;O&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;PrimaryKey&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;O&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;AutoInc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Rep&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;](&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;age&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Rep&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;](&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;age&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;occupationId&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Rep&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;](&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;occupation_id&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;occupationFk&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;ForeignKeyQuery&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;OccupationTable&lt;/span&gt;, &lt;span class=&quot;kt&quot;&gt;Occupation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt;
      &lt;span class=&quot;nf&quot;&gt;foreignKey&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;fk_person_occupation&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;occupationId&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;occupations&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;onUpdate&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;ForeignKeyAction&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;Restrict&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;onDelete&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;ForeignKeyAction&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;Cascade&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;ProvenShape&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Person&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;age&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;occupationId&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;mapTo&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Person&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;lazy&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;persons&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;TableQuery&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tag&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;PersonTable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ExampleDAO&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;implicit&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;executionContext&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;ExecutionContext&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;databaseConfig&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;DatabaseConfig&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;JdbcProfile&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;])&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;DatabaseDefinitions&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;profile&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;databaseConfig&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;profile&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;profile.api._&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;getBela&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Future&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Person&lt;/span&gt;, &lt;span class=&quot;kt&quot;&gt;Occupation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;databaseConfig&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;persons&lt;/span&gt;
      &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Bela&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;occupations&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;occupationId&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;result&lt;/span&gt;
      &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;head&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As you can see Slick requires more boilerplate and as a result it does return a tuple of objects instead of the nice nested ones Anorm gives out of the box.&lt;/p&gt;

&lt;p&gt;But from the point on if you define the database table, its case class representation and their transformation rule (the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;def *&lt;/code&gt; ) you can use typesafe function calls on any &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TableQuery&lt;/code&gt; objects.&lt;/p&gt;

&lt;h2 id=&quot;take-aways&quot;&gt;Take aways&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Functional-relation mapping is a thing, despite it is not a definition in Wikipedia&lt;/li&gt;
  &lt;li&gt;Treat your database software as a first class citizen&lt;/li&gt;
  &lt;li&gt;SQL is a powerful and elegant language, don’t try to hide it too much&lt;/li&gt;
  &lt;li&gt;Scala and functional programming could help a lot in data transformation&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Wed, 15 Mar 2023 20:21:00 +0000</pubDate>
        <link>http://koles.hu/2023/slick-intro-to-functional-relational-mapping/</link>
        <guid isPermaLink="true">http://koles.hu/2023/slick-intro-to-functional-relational-mapping/</guid>
        
        <category>featured</category>
        
        <category>tech</category>
        
        
      </item>
    
      <item>
        <title>Why Unsplash?</title>
        <description>&lt;p&gt;Let’s start the story from far…&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/2020-04-23-why-unsplash.jpg&quot; alt=&quot;My current Unsplash toplist&quot; /&gt;&lt;/p&gt;

&lt;p&gt;As a hobby photographer I always looking for places my photos can fit into. I started with my own handmade websites, but soon I realized it takes too much time from me to create a site which stands out from the crowd. After some dead-end, straight to the drawer webpages I turned to something else, actually a series of different sites I joined and tried to fit my photos and my hobby into.&lt;/p&gt;

&lt;h2 id=&quot;fotozzhu&quot;&gt;Fotozz.hu&lt;/h2&gt;
&lt;p&gt;At first I joined a Hungarian photography website called &lt;a href=&quot;http://fotozz.hu&quot;&gt;Fotozz.hu&lt;/a&gt;. The focus of that site back then was to gather photographers into a group where everyone tries to help each other with feedbacks so everyone in the community will learn a lot from each other and thrive to become a great photographer. For every feedback the site gave points, on the other hand to upload a photo I had to use some points. So this was the main motivator to spend some time with someone else’s photo and give them some feedback. After a while, a lot of people transformed to sharp-eyed photo critiques, picky and negative ones, which torn down my motivation to post any photo or give any feedback. I also realised I did not learn too much from the other non-educated, mostly rookie/hobby photographers. I felt like being in the kindergarten without a teacher… it was fun at the beginning, but it became boring and frustrating.&lt;/p&gt;

&lt;h2 id=&quot;facebook&quot;&gt;Facebook&lt;/h2&gt;
&lt;p&gt;As most of us I posted some of my photos to Facebook: besides the low quality, random photos I uploaded project-like albums. That was a totally different thing, it seemed like finally I can upload as many photos as I want, share it with friends and forget the critiques. But as you might have guessed I got some likes and some generic “very cool pics”, “wow amazing”, etc… comments. Which became boring and pointless while I was still looking for feedback and some direction I can grow. So I dropped the album and photo posts and went with the crowd into the total nonsense what we know Facebook is all about… but I looked somewhere else, a technical challenge of keeping my photos safe and organized, because the amount of them exceeded the capacity of my hard drives.&lt;/p&gt;

&lt;h2 id=&quot;flickr&quot;&gt;Flickr&lt;/h2&gt;
&lt;p&gt;I joined Flickr quite late, I think they were already over the top back then. I think their original concept was closer to Instagram than Google Photos (or Picasa) they transformed into. I used Flickr to store my photos in the cloud instead on my always risky hard drives (back then they announced the 1TB storage plan for free). They also provided some management and sharing capability so I was able to put my fine selections into albums. Despite the rusty admin pages and not-so userfriendly (compared to Google Photos) UI I spent huge amount of time uploading and sorting my photos there… despite the efforts I put into it I left Flickr for two reasons: it was hard to use it as a photo library and I was not able to put together my “professional” portfolio.&lt;/p&gt;

&lt;h2 id=&quot;meanwhile&quot;&gt;Meanwhile&lt;/h2&gt;
&lt;p&gt;I spent a lot of time from the beginning to find my photo storage and library management solution. After I dropped the “create a date folder and put photos there” approach I used Canon’s ImageBrowserEx I got with as I bought my first camera. Then I converted everything into Apple’s iPhoto when I switched over to Macs, then into Aperture’s library, then to Photos when Apple killed both, then I tried Lightroom and I went back to Photos. I played with the idea to manage everything with Google Photos too, but I could not find it “pro” enough, it is more like a good backup and sharing platform rather than a versatile photo library for my needs.&lt;/p&gt;

&lt;p&gt;I used Aperture’s website export feature and my own handmade site to put together my own portfolio site. Here is a small peek into the past: https://web.archive.org/web/20080612085153/http://www.koles.hu/
Unfortunately the content is lost, only the frontpage is archived. I managed a blog back then, posting various stuff, sometimes photo projects too. None of these tries fulfilled my expectations.&lt;/p&gt;

&lt;h2 id=&quot;the-stock-photo-sites&quot;&gt;The stock photo sites&lt;/h2&gt;
&lt;p&gt;I tried to get access to some stock photo sites: Getty images and Shutterstock, hoping that I might be able to earn some money from the photos I’ll put there. I failed to get through the filters, but I was not super determined to do that, I gave up after 2 or 3 tries. I looked elsewhere, something that doesn’t feel like working, where the first requirement is uploading photos and not fulfilling the customers’ needs.&lt;/p&gt;

&lt;h2 id=&quot;500px&quot;&gt;500px&lt;/h2&gt;
&lt;p&gt;500px started as a photo community/sharing site, which evolved into a mix of portfolio and marketplace for photographers. When I joined in 2011, back then their page was one of the best looking photo sites around. They had a marketplace too which made 500px even more desired for my eyes. I uploaded my finest selection of photos and put them to the marketplace and I still upload some photos there time-to-time: &lt;a href=&quot;https://500px.com/kolesm&quot;&gt;My 500px profile&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’m proud that I sold some photos there and later when they struck a deal with Getty Images my photos appeared there too. I choose the long road, but I liked it.
What I still like about 500px is that they kept this portfolio aspect and they did not push the social side too much, also there is always a chance to make some money out of my hobby (even that income could not buy me the equipment and time I spend on it).&lt;/p&gt;

&lt;h2 id=&quot;instagram&quot;&gt;Instagram&lt;/h2&gt;
&lt;p&gt;After I got disillusioned with Facebook I joined Instagram (back then they were independent from the big brother) and I enjoyed the visual blog aspect of it. It was great to find some really good photographers or just funny photos from sharp-eyed people without any serious attachment to photography. I used Instagram as my blog back then, but later I transformed it into something else: an ad-site for my 500px portfolio and my Facebook photography page I put together as a marketing trick. So Instagram became my ad platform for another ad platform to promote my money chasing effort on 500px. Yes this sounds pathetic I know, so I gave up on this after a while.&lt;/p&gt;

&lt;p&gt;I lost my interest in Instagram for different reasons: the daily routine of scrolling through so many not categorized photos - the funny ones, friends’ photos, pro photographers’, ads… - became a useless habit as I could not get anything out of that. I did not learn or get inspiration from the photos I scrolled through like a robot.
As a last idea I started to put together some thematic profiles there, but eventually I realized this mobile only, small size images feed is not my platform, it does not inspire me at all.&lt;/p&gt;

&lt;h2 id=&quot;unsplash&quot;&gt;Unsplash&lt;/h2&gt;
&lt;p&gt;My last stop so far is at &lt;a href=&quot;https://unsplash.com/@mihaly_koles&quot;&gt;Unsplash&lt;/a&gt;. They created a Tumblr page posting photos for free. They left Tumblr and built their own site from the ground up, but they kept the free photos for everyone aspect. So all my photos on Unsplash are free to use.&lt;/p&gt;

&lt;p&gt;So why am I uploading any photo to Unsplash, what is the motivation?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Photography is my hobby, my free-time activity, I do it because I love taking photos, retouch them and see how they transform into something I want to preserve from the moment I witnessed.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Sometimes that moment I try to freeze into the photo is just a memory important for me only, sometimes it can cheer other people up or make them whisper “wow”.&lt;/p&gt;

&lt;p&gt;It is my accomplishement to have a photo I imagined or get surprised what I can get out from it I did not see when I took it. It is my craftmanship, my l’art pour l’art I don’t have to explain.&lt;/p&gt;

&lt;p&gt;Unsplash is a good place for that. I don’t feel the tension to upload something that can be used in someone else’s presentation, ad campaign, motivational book, etc… That is my free-for-all portfolio I can offer as a gift to anyone and they can take it if they want.&lt;/p&gt;

&lt;p&gt;No pressure, no judgement, no orders, just the purest feedback from data: my photos were downloaded more than 73.000 times and viewed more than 17 million times… and counting.&lt;/p&gt;
</description>
        <pubDate>Thu, 23 Apr 2020 23:57:00 +0000</pubDate>
        <link>http://koles.hu/2020/why-unsplash/</link>
        <guid isPermaLink="true">http://koles.hu/2020/why-unsplash/</guid>
        
        <category>featured</category>
        
        <category>photo</category>
        
        
      </item>
    
      <item>
        <title>First steps with an international domain</title>
        <description>&lt;p&gt;At the beginning of this year I bumped into the realization that despite I own koles.hu, my family name is actually Köles and I don’t own that domain. After a quick lookup I saw that köles.hu was still available, so I immediately bought.&lt;/p&gt;

&lt;p&gt;Then I realized that I did not research if Github pages could support this kind of domain and if there is a way to host a page for more than one domain.&lt;/p&gt;

&lt;h2 id=&quot;short-story-quick&quot;&gt;Short story quick&lt;/h2&gt;
&lt;p&gt;Github support such domains, and they don’t support multiple domains for a page.&lt;/p&gt;

&lt;h2 id=&quot;short-story-short&quot;&gt;Short story short&lt;/h2&gt;

&lt;p&gt;I wanted to test if Github could host any page for the new domain. So I created a new repo and enabled Github pages for it, then I tried to add the domain, which failed as I have to use the “Punycoded” version of the domain.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/2020-02-17-internationalised-domain.png&quot; alt=&quot;Guthub pages setup&quot; /&gt;&lt;/p&gt;

&lt;p&gt;(You can check the details how you can use Github pages &lt;a href=&quot;/2016/almost-free-webhosting/&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://pages.github.com&quot;&gt;here&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Nice thing I noticed is that Github added support for HTTPS, I missed the nice lock in the address bar for years, so I happily ticked the checkbox.
I expected that I have to provide the certificate too, but they managed to use their own. Nice job Github!&lt;/p&gt;

&lt;p&gt;So I went further to use koles.hu and the new köles.hu for the same page. So far I’ve failed to do that. Github explicitly states that they don’t support multiple domains, the best I can do is to add a CNAME record to one of my DNS table, so browsers can jump to the canonical one. So far I failed to set that record with my DNS provider, so I used the lame old trick of HTML header redirect, so whenever you open my page on the old domain it relocates your browser to the new one.
And there are problems: if you bookmarked any page that bookmark won’t work, because I created redirect for the main page only.&lt;/p&gt;

&lt;p&gt;Next chapter would be to figure out how to redirect everything…&lt;/p&gt;
</description>
        <pubDate>Mon, 17 Feb 2020 10:00:00 +0000</pubDate>
        <link>http://koles.hu/2020/internationalised-domain/</link>
        <guid isPermaLink="true">http://koles.hu/2020/internationalised-domain/</guid>
        
        <category>featured</category>
        
        <category>tech</category>
        
        
      </item>
    
      <item>
        <title>Photo gallery site and the course I took</title>
        <description>&lt;p&gt;In 2018 I attended a photography class organized by &lt;a href=&quot;http://open.mome.hu&quot;&gt;MOME&lt;/a&gt;.
My goal was to get closer to how photography as a form of art works.&lt;/p&gt;

&lt;p&gt;I consider myself a hobby photographer, I take photos mostly for my pure joy.
I have not held any professional or amateur exhibition before, but as the closing ceremony of this course I showed my exam photo series to a small audience along with my fellow classmates of 12 people.&lt;/p&gt;

&lt;p&gt;At least that was the plan, but unfortunately the exhibition lasted only a couple of hours. So my intent of inviting friends to check my photos failed miserably. I was angry, I was pissed off on how short sighted the organizers were. All of us were angry back then.&lt;/p&gt;

&lt;p&gt;Two ideas came to light that night. The first was that I can create a &lt;strong&gt;virtual exhibition&lt;/strong&gt; to show all the photos from all the classmates. So at least on the web we can can have our corner to invite our friends into.
The second one was creating a photography coaching service for people like us in need for guidance to open wings and fly.&lt;/p&gt;

&lt;p&gt;This post is about the first idea. Back to the photos as I want to introduce them a bit. The title of the task we had to accomplish was: &lt;em&gt;“Dream, Ecstasy, Vision”&lt;/em&gt;. Behind this vague definition the real goal was to find something that motivates us and gives the photos some direction and cohesion. Under this umbrella we had to form our message or theme we wanted to express. So as you will see we all chose different topics for our “thesis”.&lt;/p&gt;

&lt;p&gt;I’ve found mine while I was commuting to work and back home on the underground lines. The lack of interaction or rather avoiding interaction between fellow commuters was something I always felt, but I had never catch it on any photo. So I started taking photos during my travels using my phone. I was quite nervous at the beginning, but it wore off in time and I started enjoying it. I tried out different ideas and two remained: the censored style and the panoramic one. The former came first as I took my first couple of photos through the window of the train while I was standing inside. People’s eyes were “censored” by the black window separators on some of the photos and that was the moment I realized the connection: &lt;strong&gt;commuters are trying to censor what they want to see and whom they want to interact with and that gives everyone the needed comfortable solitude&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The panoramic photos came later and it took me some time to practice the technique, also I had to post-process these photos a lot; all them were blended from at least two or more panorama shots.&lt;/p&gt;

&lt;p&gt;Finally some technical details about the site: I chose to use &lt;a href=&quot;https://photoswipe.com&quot;&gt;PotoSwipe&lt;/a&gt; to handle the image show and all the interactions. I created the “design” from scratch. My goal was to create a very minimalistic site and put the spotlight to the individual galleries, as they are the main attraction. My secondary goal was to have a decent mobile viewing experience, similar what you can get on your mobile OS *photos app.&lt;/p&gt;

&lt;p&gt;And now, here is the link to the &lt;a href=&quot;http://köles.hu/foto2.0/&quot;&gt;Foto2.0 gallery&lt;/a&gt; page. I hope you’ll enjoy the photos.&lt;/p&gt;
</description>
        <pubDate>Wed, 01 May 2019 22:30:00 +0000</pubDate>
        <link>http://koles.hu/2019/foto2-gallery-site-launch/</link>
        <guid isPermaLink="true">http://koles.hu/2019/foto2-gallery-site-launch/</guid>
        
        <category>featured</category>
        
        <category>photo</category>
        
        
      </item>
    
      <item>
        <title>Google Maps made my photo famous</title>
        <description>&lt;p&gt;Today I received an email from Google Maps.
They gave me one point(!) because my only photo there reached more than 1000 views.&lt;/p&gt;

&lt;p&gt;Now it has &lt;a href=&quot;https://www.google.com/maps/contrib/110617674437473699686/photos/@59.3689348,24.1344537,15z/data=!4m3!8m2!3m1!1e1&quot;&gt;2947 views exactly&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Not any of my photos reached that popularity, thanks Google Maps.&lt;/p&gt;

&lt;p&gt;Such an interesting turn of events.&lt;/p&gt;

&lt;p&gt;I’m not sure what I can do with that single orphan point I received. Now I’m a Level 1 local guide.
Should I be proud?&lt;/p&gt;
</description>
        <pubDate>Fri, 22 Apr 2016 20:02:11 +0000</pubDate>
        <link>http://koles.hu/2016/google-maps-photo/</link>
        <guid isPermaLink="true">http://koles.hu/2016/google-maps-photo/</guid>
        
        <category>featured</category>
        
        <category>photo</category>
        
        
        <category>blog</category>
        
      </item>
    
      <item>
        <title>Almost free webhosting</title>
        <description>&lt;p&gt;So my new webpage/blog is hosted by &lt;a href=&quot;https://pages.github.com&quot;&gt;GitHub Pages&lt;/a&gt;.
That is basically a free service with limitations. It handles static files only, no DataBase, no homegrown server-side PHP scripts.
So the idea is to put your HTML files into GitHub and they will serve. To get the most out of it, you should use some framework. It would help you to overcome the boilerplate this offer requires.&lt;/p&gt;

&lt;p&gt;The first obvious candidate is &lt;a href=&quot;http://jekyllrb.com/&quot;&gt;Jekyll&lt;/a&gt;, which is the default FW for GitHub Pages.
Others can be used, but with them you have to upload the generated content, but with Jekyll this step is not required.&lt;/p&gt;

&lt;p&gt;Jekyll is a “markdown to webpage” transformer. It reads all content - pages and posts - from separate files and gathers the meta-data then generates a couple of html pages. It features a handy template engine with layout helpers and plugins.&lt;/p&gt;

&lt;h2 id=&quot;what-do-you-have-to-do-to-start-with-github-pages-and-jekyll&quot;&gt;What do you have to do to start with GitHub Pages and Jekyll?&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;First you have to have a registered user on GitHub.&lt;/li&gt;
  &lt;li&gt;Create a new public repository, name it like: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;username&amp;gt;.github.io&lt;/code&gt;. (Replace &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;username&amp;gt;&lt;/code&gt; with your GitHub username.)&lt;/li&gt;
  &lt;li&gt;Install &lt;a href=&quot;https://www.ruby-lang.org/en/&quot;&gt;Ruby&lt;/a&gt; then Jekyll: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gem install jekyll&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Create a new site with Jekyll: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jekyll new &amp;lt;username&amp;gt;.github.io&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Go into the folder and run Jekyll: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jekyll serve&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Open the site in your &lt;a href=&quot;http://0.0.0.0:4000&quot;&gt;browser&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Write your first post.&lt;/li&gt;
  &lt;li&gt;Push your local repo to GitHub and open your site: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://&amp;lt;username&amp;gt;.github.io&lt;/code&gt;. For example this site could be opened at &lt;a href=&quot;http://nyuwec.github.io&quot;&gt;http://nyuwec.github.io&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;i-want-my-own-domain&quot;&gt;I want my own domain!&lt;/h2&gt;

&lt;p&gt;Ok, no problem, but this part &lt;strong&gt;won’t come for free&lt;/strong&gt;: you have to buy a domain.
Then you should create a file named CNAME in the root of your shiny new site and put your domain into it like &lt;a href=&quot;https://github.com/nyuwec/nyuwec.github.io/blob/master/CNAME&quot;&gt;this&lt;/a&gt;. Don’t forget to push.&lt;/p&gt;

&lt;p&gt;Now you should go to your domain registrator and add at least one &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;A&lt;/code&gt; DNS record. Most preferably use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*&lt;/code&gt; as subdomain and add these IPs: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.30.252.153&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.30.252.154&lt;/code&gt;. (If you can only set one IP, it is enough.)&lt;/p&gt;

&lt;p&gt;After you wait TimeToLive amount of time check domain-IP mapping by executing this command:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dig &amp;lt;yourdomain.com&amp;gt; +nostats +nocomments +nocmd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You should see something like this:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.3-P1 &amp;lt;&amp;lt;&amp;gt;&amp;gt; &amp;lt;yourdomain.com&amp;gt; +nostats +nocomments +nocmd
;; global options: +cmd
;&amp;lt;yourdomain.com&amp;gt;.			IN	A
&amp;lt;yourdomain.com&amp;gt;.		121	IN	A	192.30.252.153
&amp;lt;yourdomain.com&amp;gt;.		121	IN	A	192.30.252.154
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;im-stuck&quot;&gt;I’m stuck…&lt;/h2&gt;

&lt;p&gt;Check the docs &lt;a href=&quot;https://pages.github.com&quot;&gt;here&lt;/a&gt; or &lt;a href=&quot;https://help.github.com/categories/github-pages-basics/&quot;&gt;here&lt;/a&gt; or &lt;a href=&quot;https://help.github.com/articles/using-a-custom-domain-with-github-pages/&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Mon, 29 Feb 2016 00:10:00 +0000</pubDate>
        <link>http://koles.hu/2016/almost-free-webhosting/</link>
        <guid isPermaLink="true">http://koles.hu/2016/almost-free-webhosting/</guid>
        
        <category>featured</category>
        
        <category>tech</category>
        
        
      </item>
    
      <item>
        <title>Welcome to KOLES.HU</title>
        <description>&lt;p&gt;Let’s start it over again, this time in English. For the sake of practicing the language
and to make it easier to type text without any funky Hungarian letters.&lt;/p&gt;

&lt;h3 id=&quot;why-new&quot;&gt;Why new?&lt;/h3&gt;

&lt;p&gt;My old webspace died and I had not received any notification about that event.
It means two things:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;It was not so popular.&lt;/li&gt;
  &lt;li&gt;I paid no attention to it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I have a database backup of the old site from 12/5/15, which means that all the text is saved.&lt;/p&gt;

&lt;h3 id=&quot;whats-next&quot;&gt;What’s next?&lt;/h3&gt;

&lt;p&gt;This is a fresh start, expect something different. I still don’t know what it would be.
(Although if I’ll have time I would convert the backup to this new format.)&lt;/p&gt;

&lt;h3 id=&quot;what-kind-of-engine-and-host-are-you-using&quot;&gt;What kind of engine and host are you using?&lt;/h3&gt;

&lt;p&gt;Hahh, good question!&lt;/p&gt;

&lt;p&gt;It’s running on &lt;a href=&quot;https://pages.github.com&quot;&gt;GitHub Pages&lt;/a&gt; and using &lt;a href=&quot;http://jekyllrb.com/&quot;&gt;Jekyll&lt;/a&gt; for the transformation.
No database, no fancy blog-engine with PHP (yuck!) code to maintain.
No FTP! I mean there is no fucking FTP is used here.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Holy crap, it’s 2016!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I’ll write a small post about the technical background… or you can figure it by yourself &lt;a href=&quot;https://help.github.com/categories/github-pages-basics/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
</description>
        <pubDate>Fri, 15 Jan 2016 23:19:31 +0000</pubDate>
        <link>http://koles.hu/2016/welcome-to-koles-hu/</link>
        <guid isPermaLink="true">http://koles.hu/2016/welcome-to-koles-hu/</guid>
        
        <category>featured</category>
        
        
      </item>
    
  </channel>
</rss>
