ãªããSQLã¯éãããªãã®ãï¼ââãSQLããã©ã¼ãã³ã¹è©³è§£ãã®ç¿»è¨³è ãæããåå ã¨å¯¾ç ãSQLããã©ã¼ãã³ã¹è©³è§£ãã®ç¿»è¨³è ã®æ¾æµ¦é¼äººããã«ã8ã¤ã®ãSQLãéãããªãåå ã¨ãã®å¯¾çããèãã¾ãããã·ã¹ãã ã®ããã«ããã¯ã«ãªããããªãåé¡ã®ããSQLããåé¿ãããã¦ãã¦ãå¦ã³ã¾ãããã ãã¼ã¿ã®æä½ãå®ç¾©ãããè¨èªãSQLãã¯ãã©ã®ãããªé åãæ ãã¨ã³ã¸ãã¢ã«ã¨ã£ã¦ãå¿ ä¿®ç§ç®ã§ãããããããã®ä»æ§ããã¡ãã¨ç解ããããã©ã¼ãã³ã¹ã«åªããSQLãæ¸ããæ¹ã¯ããã»ã©å¤ãããã¾ãããåé¡ã®ããSQLãæ¸ãã¦ãã¾ããç¥ãã¬éã«ãããã·ã¹ãã ã®ããã«ããã¯ã«ãªã£ã¦ãã¾ãäºæ ã¯ããçºçãã¾ãã ã§ã¯ãã©ãããã°ããããäºæ ãåé¿ã§ããã®ã§ããããï¼ ãã®ãã¦ãã¦ãå¦ã¶ãããä»åã¯ãSQLããã©ã¼ãã³ã¹è©³è§£ãã®ç¿»è¨³è ã§ãããèªèº«ãã¨ã³ã¸ãã¢ã§ãããæ¾æµ¦é¼äººï¼ã¾ã¤ããã»ã¯ãã¨ï¼@dblmktï¼ããã«8ã¤
JJUG CCC 2017 Springã§ãããã¼ã¿å±¥æ´ç®¡çã®ããã®ãã³ãã©ã«ãã¼ã¿ã¢ãã«ã¨Reladomoã®ç´¹ä»ãã¨ãã話ããã¦ãã¾ããã ãã¼ã¿å±¥æ´ç®¡çã®ããã®ãã³ãã©ã«ãã¼ã¿ã¢ãã«ã¨Reladomoã®ç´¹ä» #jjug_ccc #ccc_g3 from Hiroshi Ito ä»åã®ç»å£ã¯ãæ ªå¼ä¼ç¤¾FOLIOã®ã¹ãã³ãµã¼ã»ãã·ã§ã³ã§ãï¼FOLIOã«ã¤ãã¦ã¯ãã¡ãã®å ¥ç¤¾ã¨ã³ããªã¼è¨äºããåèãã ãããToggetterã¯ä¸ã®ãªã³ã¯ããã togetter.com ä¸ã®ä¸ã®ã¿ãªããããè«çåé¤ãã©ã°ãã使ããããªãã¢ããã¼ã·ã§ã³ã¨ãã¦ã¯ãå®ã¯ãåé¤ãã§ã¯ãªãå¥ã®ãã¸ãã¹ãã¸ãã¯ãå®è£ ãããã ãã§ãããã¨ãã»ã¨ãã©ã ã¨æãã¾ãã ãã¨ãã°è«çåé¤ãã©ã°ã¨ããåã®æ»äº¡ãã©ã° - @ledsun blogã¨ããã¨ã³ããªãåèã«ããã¦ããã ãã¨ãä¸è¨ã®ãããªè¦ä»¶ã®ä¾ãããã¾ãã ã»ç¤¾å¡ãéè·ï¼ã»è»¢
ãã®ã¨ã³ããªã§ã¯ãGrzegorz Gajosã«ããè¨äºãHow Hibernate Almost Ruined My Careerãç´¹ä»ããã (Grzegorzããå訳ã¨è»¢è¼ã®è¨±å¯ã¯å¾ãã) 以ä¸ã¯ãã®å ¨æã®å訳ã ããæè¨³è¶ è¨³ãæ··ãã£ã¦ããã®ã§ããã¨ã®ãã¥ã¢ã³ã¹ãç¥ããããã°å è¨äºãèªãã§ãããããèªã¾ãªãã¦ãããã æ³åãã¦ããã åã¯Javaéçºè ã§ã次ã®ããã°ããã¸ã§ã¯ããéå§ãããã¨ãã¦ããã¨ããã ã åã¯ããã®ããã¸ã§ã¯ãå ¨ä½ã«å½±é¿ããæ ¹æ¬çãªæ±ºæãããå¿ è¦ãããã åã®æè»ãªãã¼ã¿ã¢ãã«ããªãã¸ã§ã¯ãæåã§æ½è±¡åãããã¹ããªæ¹æ³ãé¸æããããçã®SQLãæ±ãããã¯ãªããããã ã©ããªç¨®é¡ã®ãã¼ã¿ããµãã¼ããããããçæ³ã§ã¯å ¨ç¨®ã®ãã¼ã¿ãã¼ã¹ããµãã¼ããããã ããã«æãã¤ãã®ã¯ãåã«Hibernateã使ãã¨ãã解ã ãããã ãï¼ Javaãã£ããããã®90%ã¯åã«åæããã
SQLãæ¸ãã¦ã¾ããï¼ ãã¨å¤§è¦æ¨¡ãã¼ã¿å¦çã®åéã«ããã¦ã¯SQLã¯ãã¯ãæ¨æºã¤ã³ã¿ã¼ãã§ã¤ã¹ã§ããã åæãããããããã«é¢ãã£ã¦ããçæ§ã¯æ¥ã 大éã®SQLã¯ã¨ãªã¼ãçç£ãã¦ãããã¨ã¨æãã¾ãã ããã§ã¡ãã£ã¨æ°ã«ãªãã®ãã SQLã®ã³ã¼ãã£ã³ã°ã¹ã¿ã¤ã«ã£ã¦ã©ãããã®ãä¸è¬çãªãã ã£ãâ¦â¦ï¼ ã¨ããç¹ã§ãã ã¤ãããã¯SQLãªãã¦O/R mapperã«åããããã¨ãå¤ããããªã®ãã ããã¨ãã³ã¼ããåºãç¯å²ã§å ±æãããã¨ããããããªããããã SQLã®ã³ã¼ãã£ã³ã°ã¹ã¿ã¤ã«ã«ã¤ãã¦è¦èããããã¨ã¯ä»ã®ããã°ã©ãã³ã°è¨èªã«æ¯ã¹ãã¨ã ãã¶å°ãªãã ãã¾ãã¡æ±ºå®çã¨è¨ããã¹ã¿ã¤ã«ããªããªã¨æãã¦ãã¾ãã ãããªããã§æ¬æ¥ã¯ãSQLã®ã³ã¼ãã£ã³ã°ã¹ã¿ã¤ã«ã«ã¤ãã¦ã®æèãæ´»çºåãããã¹ãã ã¯ãã¯ãããã§ãããï¼éæ¨ï¼ã使ã£ã¦ããã³ã¼ãã£ã³ã°ã¹ã¿ã¤ã«ããç¹å¾´çãªç¹ãç´¹ä»ãããã¨æãã¾ãã ç¹ã«ãåæ
å ¨å½ã®ãã¼ã ããµããã®ã¿ãªããããä¹ ãã¶ãã§ãã 1ã¶æã»ã©æ´æ°ããªãã£ãã®ã§ããç§ã¯å æ°ã§ãã 表é¡ã®éããPHPã«ã³ãã¡ã¬ã³ã¹2016ã«éã³ã«è¡ã£ã¦ããã®ã§ãã®ãå ±åã§ãã å½æ¥ã®ã¹ã©ã¤ãã¯ãã¡ã ä»åã¯RDBã¢ã³ããã¿ã¼ã³ã¨ãããã¨ã§ä»¥ä¸ã®å 容ã話ãã¦æ¥ã¾ããã ã¾ãã¹ã©ã¤ãã ãã§ã¯è¨è足ãããªã®ã§è£è¶³è¨äºæ¸ãã¾ããã ä¸ã®ãªã³ã¯ã§è£è¶³è¨äºã«è¡ãã¾ã å¼·ãããä¾å é ãããç¶æ ããã¯ã®å罪 ã¹ã©ã¤ãã ãã§ã¯èª¬æããããªãã®ã§ãã²åç»ãè¦ã¦ã»ããã§ã PHP Conference 2016 Track2 ã®youtubeã¿ã¤ãããRDBã¢ã³ããã¿ã¼ã³ã®åç»ãè¦ããæ¹ã¯ãã¡ãï¼ >> https://t.co/HuEGceG9sB â ãã¼ã ãï¼ å代ALF (@soudai1025) 2016å¹´11æ4æ¥ ããã¨å½æ¥ã®Twitterã¾ã¨ã DBã®å¯¿å½ã¯ã¢ããªãããé·ãï¼DBãæããè±é
ã¿ã¤ãã«ã¯è¥å¹²é£ãã§ãã CakePHPã«ã¯ãã¤ã°ã¬ã¼ã·ã§ã³ãã¼ã«ã¨ãã¦ãCakeDC/Migrations(CakePHP2)ããPhinxãã¼ã¹ã®cakephp/migrations(CakePHP3)ãããã¾ãã ã¨ã¦ãæç¨ã§ãããCakePHP Bakerã¯ã¿ããªç¥ã£ã¦ãããã¼ã«ã§ããèªåããã£ã¨ãä¸è©±ã«ãªã£ã¦ãã¾ããã ãã ãã¡ããã¡ããå°ããã¨ããã£ãã®ã§ãæè¿ã¯Ridgepoleã使ãå§ãã¦ãã¾ãã Ridgepole github.com Ridgepoleã¯ã¯ãã¯ããã社ã§å©ç¨ããã¦ããã¨ãããã¤ã°ã¬ã¼ã·ã§ã³ãã¼ã«ã§ãã techlife.cookpad.com Ridgepoleã¯æ大ã®å©ç¹ãã1ã¤ã®Schemafileã管çããã ãã§ã¹ãã¼ãã®ã¹ãçæ§ãæ ä¿ãã¦ãããã¨ãããã¨ã§ãã Ridgepoleã¯DSLèªä½ãRailsã®ActiveRecordã¨åãã ã¨ããã
ãã©ã³ã¶ã¯ã·ã§ã³ã®å®è£ ã«ã¯RDB/NoSQLã«ãããããæç§æ¸çãªå®çªãããï½æ¥åã·ã¹ãã ãRDBãªãã§ä½ããã®ãï¼ï¼åç·¨ï¼ ã¨ã³ã¸ãã¢ãµãã¼ãCROSS 2016 æ°å¹´åã«NoSQLãç»å ´ããå½æãNoSQLã«ã¯ãã¼ã¿ã®ä¸è²«æ§ãä¿è¨¼ãã¦ããããã©ã³ã¶ã¯ã·ã§ã³æ©è½ãªã©ãååã«åãã£ã¦ããªããããæ¥åã·ã¹ãã ã®ããã¯ã¨ã³ãã¨ãã¦ä½¿ãã®ã¯å®¹æã§ã¯ãªãã¨èãããã¦ãã¾ããã ããããã®å¾ãNoSQLãããã¯ã¨ã³ãã«ããæ¥åã¢ããªã±ã¼ã·ã§ã³ã¯ç¾å®ã«ã¯ããã¤ãç»å ´ãã¦ãã¦ãã¾ããã¯ã¼ã¯ã¹ã¢ããªã±ã¼ã·ã§ã³ãºã2014å¹´ã«çºè¡¨ããERPã®ãHUEããCassandraãããã¯ã¨ã³ãã«æ¡ç¨ãããæ¬æ ¼çãªæ¥åã¢ããªã±ã¼ã·ã§ã³ã§ãã ãã®HUEã®éçºã«é¢ããã¹ã¿ããããã©ãããå®è£ ãªãã°NoSQLãæ¥åã¢ããªã±ã¼ã·ã§ã³ã®ããã¯ã¨ã³ãã«ä½¿ããã®ããããã«ã¯ã©ãããæå³ãããã®ãããªã©ã«ã¤ãã¦è°è«ããã»ãã·ã§ã³ã
åå ã¨ããããåé¤ãã©ã° ç®ç ã¨ã³ãã¦ã¼ã¶ããè¦ãã¨ãã¼ã¿ããªããã¨ã«ããããã©ãå®éã®ãã¼ã¿ã¯æ¶ããããªã åé¤ãããã¼ã¿ãæ¤ç´¢ããã ãã¼ã¿ãæ¶ããã«ãã°ã«æ®ããã 誤ã£ãæä½ããªãã£ããã¨ã«ããããç´ãã«å ã«æ»ããã ã¢ã³ããã¿ã¼ã³ ä¾ãã°is_deletedã¨ããã«ã©ã ãtrueã®å ´åã¯åé¤ããã¦ããã¨ã¿ãªã ã¡ãªãã updateæãªããã¼ã¿ãç°¡åã«å ã«æ»ããæ°ãããã®ã§ãªãã¨ãªãå®å¿ -> 俺ã®updateæã§ãªãã¨ããªãï¼ï¼ èµ·ããã㨠SELECTããã¨ãã«ã¯å¸¸ã«WHEREå¥ã追å ã§å¿ è¦ã«ãªããã³ã¼ããåé¤ãã©ã°ã ããã«ãªã å ¨å¡ãã¼ãã«è¨è¨ã«ç²¾éãã¦ãããã§ã¯ãªãã®ã§ããã¼ãã«ã«ãã£ã¦åé¤ãã©ã°ã®æç¡ããã£ããããå ´åãèªèã®é½é½¬ãçã¿ããã ä¾ãã°rubyã§default_scopeãç¨ãã¦ããããã¨ããã£ã¦ã³ã¼ãã¬ãã«ã§ããã©ã«ããå¤ããããã°ãããããåºã¦ãã
ããã«ã¡ã¯ããã£ããç§ã§ããï¼@yone098 ã§ãã ã¿ãªããDBã®è¨è¨ãã¦ã¾ããï¼ DBè¨è¨æã®ãµã¤ãºè¦ç©ã 以åã¯ã¦ãªãã¤ã¢ãªã¼ã§æ¸ããè¨äºã¯5å¹´åã®ãã®ã§ããããªã³ã¯ãåãã¦ãããã®ãããã®ã§ææ°çã¨ã㦠MySQL, PostgreSQL, Oracle, SQLServer ã«ãããDBè¨è¨æã®ãµã¤ãºè¦ç©ããã¾ã¨ãç´ãã¾ããã MySQL URLå ã®ãã¼ã¸ã§ã³è¡¨è¨ãå¤ããã¨ä»¥åã®ãã¼ã¸ã§ã³ã®æ å ±ã«ãªãã¾ãã MySQLã¯ããã¾ãæ å ±ã«å¤åã¯ç¡ãã£ãã®ã§ Excel ã§ãã¯ããªã©ãä½æãã¦èªç¤¾ã§èªåç®åºåºæ¥ãããã«ããã®ãè¯ãã¨æãã¾ãã ãã¼ã¿ã¿ã¤ããã¨ã«å¿ è¦ãªè¦æ±ã¹ãã¬ã¼ã¸ã決ã¾ã£ã¦ããã®ã§ã¬ã³ã¼ããµã¤ãºã決ã¾ãããã¨ã¯è¦ä»¶æ¬¡ç¬¬ã§ä½ã¬ã³ã¼ãã«ãªãããäºæ¸¬ãã¾ãã ãã¼ã¿ã¿ã¤ããã¨ã«å¿ è¦ãªè¨æ¶å®¹é ãã¼ãã«ã®æ大ãµã¤ãºé¢é£ http://dev.mysql.com/doc/re
DBã®ã¹ãã¼ããçæ§ã©ã®ããã«ç®¡çããã¦ããã§ããããã Railsãå©ç¨ããã¦ããæ¹ã®å¤ãã¯ãActiveRecordã®ãã¤ã°ã¬ã¼ã·ã§ã³ãå©ç¨ãã¦ç®¡çãããã¦ãããã¨æãã¾ãã ç§ããã¾ã¾ã§ããã¤ãã®Railsããã¸ã§ã¯ãã«é¢ãã£ã¦ãã¾ãããã ã»ã¼å ¨ã¦ã®ããã¸ã§ã¯ãã§ActiveRecordã®DBãã¤ã°ã¬ã¼ã·ã§ã³ãå©ç¨ãã¦ãã¾ããã (ä¸é¨ã®ããã¸ã§ã¯ãã¯ActiveRecordã使ã£ã¦ããªãããããã¤ã°ã¬ã¼ã·ã§ã³ãç¬èªã®ãã®ãå©ç¨ãã¦ãã¾ã) ActiveRecordã®ãã¤ã°ã¬ã¼ã·ã§ã³ã§ã¯ãDBã¹ãã¼ãå¤æ´ã®å·®åæ å ±ããã¤ã°ã¬ã¼ã·ã§ã³ã¹ã¯ãªããã¨ãã¦ä¿åãã¦ããã¾ããä¾ãã°ãæ°ãããã¼ãã«ãusersããä½æããå ´åã¯ãä¸è¨ã®ãããªãã¤ã°ã¬ã¼ã·ã§ã³ã¹ã¯ãªãããä½æãã¾ãã class AddUsers < ActiveRecord::Migration def up # ããã«ãã¤ã°
ããã¯ãåããã¼ã¿ãã¼ã¹ãæ±ããã¡æåããï¼ä»¶ç®ã®ããã¸ã§ã¯ãã ã£ãã C++ã®ã½ã¼ã¹ãé£è§£ã§ç«ãå¹ãã¦ããã¨ãã話ã§ãèªåã¯ä½ã¹ãã«ã®è¥é ãç«ã«ãã¹ãã«ã¯ä¸åº¦è¯ãç¨åº¦ã®ããæ°ã¨è²¬ä»»æããã£ã¦ãããææªãå¥ã®ããã¸ã§ã¯ããçµäºããç´å¾ã ã£ããã®ã§æå ¥ãããã®ã§ããã ç¾å ´ã§ãDBãããã¼ã¿ãå¸ãåºããã¼ã«ãSQLãä½ã£ã¦ãããã¨ããã話ãããã¨ä»ç¤¾ãä½ã£ãDBå®ç¾©ãããã¶ã使ãã¥ããã¨ããã ERå³ãDBå®ç¾©ãè¦ãã¦ãã ããã¨è¨ã£ãã®ã ãã©ããããªãã®ã¯ç¡ãã¨ããè¿äºã ä»ãªãããããã辺ã§éãåºãã¨ããã§ãããå½æã¯ããµã¼ãããã¦ãªããã§ãããããã¨ãããã®ããããã®è»½ãæ°æã¡ã§èãã¦ãã¾ããã ã§ãããã¸ã§ã¯ãã®è³æããããã¾ãã£ã¦ä½ã¨ãDBå®ç¾©ã®ãããªãã®ãè¦ã¤ãDBã®ãã¼ã¿ã調æ»ãå§ããã®ã§ããä½ããããããã æ©è½ã®æ°ã«æ¯ãã¦ç°æ§ã«ãã¼ãã«æ°ãå°ãªãã®ã§ãã ãµã¨å¨ããè¦ãã¨ãç
DBã¨ã³ã¸ãã¢ã®ããã®æè¡åå¼·ä¼ï¼ç¬¬3åï¼ã§ä½¿ç¨ããè³æã§ãã主ã«ãªã¬ã¼ã·ã§ãã«ã¢ãã«ã¨æ£è¦åã«ã¤ãã¦è§£èª¬ãã¦ãã¾ãããªã¬ã¼ã·ã§ãã«ã¢ãã«ã®éçã«ã¤ãã¦æ£ããèªèãã¦ããããªã¬ã¼ã·ã§ãã«ã¢ãã«ãç解ããã¨è¨ããã¨æãã¾ãã
ãã¼ãã«è¨è¨ã«ããã¦ã«ã©ã ã®ãã¼ã¿åãæ£ãã決ãããã¨ã«ã¯ãã©ã®ãããªå©ç¹ãããã®ãã«ã¤ãã¦ãåç´ã«æ±ãå¤ã¨åãåãé¸ã¶ã¹ãã§ããã¨ããã ãã§ã¯ãªãããªãããããã¹ããã«ã¤ãã¦ãå é¨çãªå¹çã®é¢ãã解説ããã ããã©ã¼ãã³ã¹ã«é¢ãã話ã®ä¸ã§ãã«ã©ã ã«å¤ãä¿åããã®ã«æ£ãããã¼ã¿åã使ããã¨ã®éè¦æ§ã説ãã¦ããã®ãèããã¨ããããããä¾ãã°ãæ°å¤ã¯INTãBIGINTã§è¡¨ç¾ããIPã¢ãã¬ã¹ã«ã¯INT UNSIGNEDã使ããVARCHAR(255)ã®ä»£ããã«VARCHAR(60)ã使ãã¨ãã£ããã¨ã ã ãã®ã¢ããã¤ã¹ã¯æ£ãããããããä»æ¥ã¯ããå°ã詳細ã®èª¬æã試ã¿ã¦ã¿ããã¨æãã çç± ãã®æé©åãæ£ããã¨æã3ã¤ã®çç±ã¯ä»¥ä¸ã®éãã ã æååã¨ãã¦æ°å¤ãã¼ã¿ãæ±ããã¨ã¯ãæåã³ã¼ããç §åå¦çã®CPUãªã¼ãã¼ããããä½è¨ã«å¿ è¦ã«ãªã£ã¦ãã¾ããä¾ãã°ã'Montréal' = 'Montrea
æ¯åº¦ããªãã¿ãã¯ã¦ãã®ãããã¨ã³ããªã«ãSIããã¡ã«ããè² ã®ã¹ãã¤ã©ã«ãã¨ããã¿ã¤ãã«ã®ã¾ã¨ããæ²è¼ããããããã æ°ã¨ã¯ããªãè¦ç¹ã¯éããã®ã®ãéçºç¾å ´ã®åé¡ç¹ã«ã¤ãã¦ã¯å°ãæãã¨ãããããã®ã§æè¦ãæ¸ãã¦ã¿ããã¨æããã¨è¨ã£ã¦ãã以ä¸ã®è©±ã®å 容ã¯ãã¼ã¿ãã¼ã¹ã¢ããªã±ã¼ã·ã§ã³ã«éå®ãã話ã§ãããã¾ãSIerã ãã«éã£ã話ã§ã¯ãªãã®ã§ãã®ç¹ã¯ã容赦é ãããããã¡ããSIeråä½ã®æ¡ä»¶ã¯ãã¼ã¿ãã¼ã¹ã¯å¿ é ãªã®ã§ãæ¬ã¨ã³ããªã§è§¦ããåé¡ç¹ã«ã¯è©²å½ããã ããã Q.ãªãçä¸ããã®ãï¼ A.æ£ãããã¼ã¿ãã¼ã¹è¨è¨ãã§ãã¦ããªãããçµè«ããè¨ããããã¼ã¿ãã¼ã¹ã¢ããªã±ã¼ã·ã§ã³ã®éçºãçä¸ããã®ã¯æ£ãããã¼ã¿ãã¼ã¹è¨è¨ãã§ãã¦ããªãããã ãããã§ãããæ£ãããã¨ã¯ãè«ççã«è¨¼æã§ããæ£ããã¨ããæå³ã§ã¯ãªãããæ¬æ¥ããããã¹ããã¨ãã£ãæå³ã§æãã¦æ¬²ããã ãçä¸ãã¨ããã®ã¯ãä¾ãã°ãã¹ããéããªããã
社å åå¼·ä¼è³æ 追è¨: 2013-10-31 ã¤ãã£ãã§ææ( https://twitter.com/akuraru/status/395822183777202176 )ãåããã®ã§å ¥ãåéåã®ãã¼ã追å ã®èª¬æã®æãä¿®æ£ãã¾ãããRead less
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}