<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>karlley_jp</author_name>
  <author_url>https://blog.hatena.ne.jp/karlley_jp/</author_url>
  <blog_title>時々とおまわり</blog_title>
  <blog_url>https://karlley.hatenablog.jp/</blog_url>
  <categories>
    <anon>Ruby</anon>
    <anon>Tips</anon>
    <anon>SQL</anon>
  </categories>
  <description>Sinatraを使ったメモアプリを開発中です。 rubyファイル内の長くて読みにくいSQLを読み易く記述する方法を調べました。 結論 ヒアドキュメントを使うと長いSQLの可読性が上がるかもしれません。 rubyファイル内のSQLは次のように書き換えることができます。 # SQLを実行するメソッド def excute(query) connection = PG::Connect.new(dbname: memo_app) connection.exec(query) end # メソッド呼び出し excute(INSERT INTO memos (id, title, content) VA…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkarlley.hatenablog.jp%2Fentry%2F2022%2F08%2F12%2F052402&quot; title=&quot;ヒアドキュメントでSQLを読み易くする - 時々とおまわり&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-08-12 05:24:02</published>
  <title>ヒアドキュメントでSQLを読み易くする</title>
  <type>rich</type>
  <url>https://karlley.hatenablog.jp/entry/2022/08/12/052402</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
