teleren/devto huggingface dataset:
Introducing our October 2018 sponsors
Tags: meta, hacktoberfest
Published: 2018-10-02 17:19:13

---
title: Introducing our October 2018 sponsors
published: true
description: Our wonderful sponsors are vital to the health of dev.to and it is great to work with companies contributing so much to the ecosystem.
tags: meta, hacktoberfest
cover_image: https://thepracticaldev.s3.amazonaws.com/i/4v5epymttjeaa41ngg88.png
---

Thank you to our wonderful sponsors who help sustain the [dev.to](https://dev.to) ecosystem and the general developer community.

These three developer platforms are leaders in their space and I urge you to check out their offerings if you have not yet done so. Seriously, take a few minutes right now to poke around their product guides and documentation.

_Also_, this month is [#hacktoberfest](/t/hacktoberfest). This is an initiative led by DigitalOcean, in partnership with Github and Twilio, centered on getting folks involved with contributing to open source. Check out the tag on [dev.to](/) for lots of guidance on where you might be able to contribute. For info on how to redeem your Hacktoberfest swag, check out [the official website](https://hacktoberfest.digitalocean.com/). 


## DigitalOcean

[DigitalOcean](https://try.digitalocean.com/performance/?utm_source=devto&utm_medium=display&utm_campaign=Devto_2018_Brand) is a much-loved cloud computing platform. I'm always impressed by how well-built _and well-documented_ the DigitalOcean core products are. It's easier said than done, and they've been able to stay ahead of the curve.

DigitalOcean has been our longest-running supporter to date, and we're extremely thankful for their consistent support.  Their commitment to the developer ecosystem is crystal clear.

## Twilio

[Twilio](https://www.twilio.com/?utm_source=devto&utm_medium=banner&utm_campaign=summer_awareness_campaign) has been a great friend of ours since early in the [dev.to](/) days. We are users of their APIs, and folks from our team are always excited to get involved in their community initiatives. It's great to have them as a sponsor!

I can personally say that we chose Twilio Video because it made really great use of native peer-to-peer browser technology while also offering Twilio's infrastructure for necessary use cases wrapped in the same API. The docs and examples were well-organized and getting up and running was a synch.

## Qlik Branch

[Qlik Branch](https://developer.qlik.com?utm_medium=direct_buy&utm_source=devto&utm_campaign=allylogo
) is a programming environment that allows you to use, explore, and quickly test apps that use Qlik technology. Qlik is a data analytics platform used in pretty much every industry for ingestion, visualization, and analysis.

Developing against these kinds of products can be burdensome without developer tools like Qlik Branch. It is this tool specifically that has our team eyeing Qlik as a possible solution as we scale [dev.to](/).

***

These organizations are helping us build the best community we can. I urge you to check out their offerings if you are in the market for their services.

Happy coding ❤️
Stop returning Null!
Tags: coding, programming, tips, tricks
Published: 2018-10-02 16:37:05

---
title: Stop returning Null!
published: true
description: A simple alternative to returning undefined values using lists.
tags: coding, programming, tips, tricks
---

We've all been there. Tireless hours of testing and careful development halted by a mysterious `NullPointerException` or similar problem all due to some undefined value. What are we to do?

Whoever came up with `null`, `None`, `nil`, etc. really hated humanity. I get it. We need a value that represents none-existence but isn't there a better way? Let's try skipping `null` altogether will lists. I'm going to show some code examples in Javascript since most people here understand it and it's a particularly stupid language given that it somehow justifies having two none-existing values `null` and `undefined`. Ah, yes, `undefined`. The Schroedinger's cat of the Web.

We might encounter the following in the wild:
```
let counter;

...some code that may or may not define counter...

if ( counter !== undefined && counter !== null ) {
    counter++;
}
```

What a mess, amirite? Some might even say we should be using `typeof` to be extra careful but we can remove this whole problem with lists. Here's a basic attempt.

```
const counters = [];

...some code that may or may not define a counter inside counters...

if ( counters.length >== 1 ) {
    counters[0]++;
}
```

Now our `if` statement is a bit simpler but we still have to check before actually performing the operation. Wouldn't it be great if we could just perform the operation without checking for `null` or if the containing list is empty? Well, let's see what our good, old friend `forEach` can do for us.

```
const counters = [];

...some code that may or may not define a counter inside counters...

counters.forEach( counter -> counter++ );
```

And, boom! This operation will never fail! If `counters` is empty then the operation will run 0 times. If `counters` has 1 counter in it, the operation will run 1 time. Finally, if `counters` has `n` counters in it, the operation will run `n` times.

Amazing! We don't need to check for undefined values anymore. We can just reliably define container lists and run list operations on those lists which guarantees that operations will not throw exceptions when no values are defined.
Using libcurl3 and libcurl4 on Ubuntu 18.04 (Bionic)
Tags: ubuntu, libcurl, curl
Published: 2018-10-02 15:49:02

---
title: Using libcurl3 and libcurl4 on Ubuntu 18.04 (Bionic)
published: true
description: Simple hack that allows libcurl3 and libcurl4 to coexist on a Ubuntu system.
tags: ubuntu, libcurl, curl
---

![image](https://thepracticaldev.s3.amazonaws.com/i/wa3vunhh44isjs2hgtkb.png)

I'm sure many of us have needed to run libcurl3 and libcurl4 on Ubuntu 18 for some reason at any point in time.

On Ubuntu 18.04 (Bionic) libcurl3 and libcurl4 cannot coexist. Many third party packages, libraries, etc require libcurl3 while curl itself requires libcurl4.

Please note, this solution is only for precompiled commands (and potentially binaries, not tested). This was tested on a [C# binary](https://github.com/tihmstar/tsschecker).

First you'll need to get a copy of libcurl3 and save it to your `/usr/lib` directory. You can do that by running:
```
$ sudo apt-get install libcurl3 -y
$ cp /usr/lib/x86_64-linux-gnu/libcurl.so.3 /usr/lib/
```

Then remove libcurl3 and reinstall libcurl4:
```
$ sudo apt-get install libcurl4 libcurl4-openssl-dev -y
```

Finally prepend `env LD_PRELOAD=/usr/lib/libcurl.so.3` to any commands that require libcurl3.
Create Dropdown Menu In React Native 
Tags: react, reactnative, android, javascript
Published: 2018-10-02 15:43:21

---
title: Create Dropdown Menu In React Native 
published: true
description: Create Dropdown Menu In React Native
tags: #react #reactnative #android #javascript
---

Post Link : <a href="https://www.skptricks.com/2018/10/create-dropdown-menu-in-react-native.html" > Create Dropdown Menu In React Native </a>

This tutorial explains how to create simple dropdown menu in react native application. The dropdown menu is most common and integral part of every mobile application, that helps user to move or navigate between different windows/screens of mobile application by selecting the option from the dropdown menu list. This dropdown menu works perfectly in Android and IOS device without any issues.

<a href="https://www.skptricks.com/2018/10/create-dropdown-menu-in-react-native.html" > Create Dropdown Menu In React Native </a>

<img src="https://1.bp.blogspot.com/-sjWQyIJ8iN8/W7OM69QBIhI/AAAAAAAAB_w/3oiOEXhREysoz5TIDzw0oUNEjzcJOyNoQCLcBGAs/s640/drop.png" />


<a href="https://www.skptricks.com/2018/10/create-dropdown-menu-in-react-native.html" > Read More... </a>
Welcome to Hacktoberfest 2018
Tags: hacktoberfest, opensource
Published: 2018-10-02 14:43:55

---
title: Welcome to Hacktoberfest 2018
published: true
description: Intoduction to Hactoberfest!
tags: hacktoberfest, open source
cover_image: https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Fs3.amazonaws.com%2Fcom.twilio.prod.twilio-docs%2Fimages%2Fhacktoberfest-2018-social-card-c8d2e1489f647f2.width-808.png&f=1
---

### What is Hacktoberfest?
**_Hacktoberfest_** is a month-long celebration of open source software run by [DigitalOcean](https://www.digitalocean.com/) in partnership with [GitHub](https://github.com/) and [Twilio](https://www.twilio.com/).

* Hacktoberfest is open to everyone in our global community!
* Five quality pull requests must be submitted to public GitHub repositories.
* You can sign up anytime between October 1 and October 31.

### How do I get started?
It's really simple...you have to follow a few steps to get into the challenge.
1. Go to [Hacktoberfest website](https://hacktoberfest.digitalocean.com/) or just google Hacktoberfest.
2. Then make sure that you have a valid GitHub account.
3. From the Hacktoberfest website signup for the challenge using your GitHub account.
4. Start hacking before the end of October.

### How do I track my progress?
Log in with your GitHub account at https://hacktoberfest.digitalocean.com/ to check your progress and stats.

### Rules
To get a shirt, you must make five pull requests between October 1–31 in any timezone. Pull requests can be to any public repo on GitHub, not just the ones we’ve highlighted. The pull request must contain commits you made yourself. Pull requests reported by maintainers as spam or that are automated will be marked as invalid and won’t count towards the shirt.

### Tips
When it comes to open source Hacktoberfest labeled projects, You will find a huge variety of projects from beginner level to expert as well as from many different languages. So, you can move with whatever programming language that you are good in.

### Some projects to get you started

#### *Hello-World*

{% github Omkar-Ajnadkar/Hello-World %}

*https://github.com/Omkar-Ajnadkar/Hello-World*

#### *Programming-Quotes*

{% github Omkar-Ajnadkar/Programming-Quotes %}
Learning JavaScript Design Patterns
Tags: javascript, designpatterns, softwaredesign
Published: 2018-10-02 14:06:53

---
title: Learning JavaScript Design Patterns
published: true
description: 
tags: #javascript #designpatterns #softwaredesign
---

I started picking up JavaScript again months ago. I created a repo for some notes that I created while learning Design Patterns in the context of JavaScript. I came from a more strongly-typed language like Java and C, now working on JavaScript I can't easily wrapped my head around applying the same general concepts that I'm used to in Java directly in JavaScript.

It's an entire paradigm shift that I might need some time getting used to, but I can feel the inner cogs of my comprehension clicking and slowly moving. I'm waiting for that day where the final click would happen and everything would just come naturally to me.

My general strategy was to pick up a book (I'm using this one [Learning JavaScript Design Patterns by Addy Osmani](https://addyosmani.com/resources/essentialjsdesignpatterns/book/)) and somewhat expound on the explanations, add more examples that I find suiting, filling the gaps. If you guys are interested feel free to watch it here's the link of the repo: [despa.js](https://github.com/vycoder/despa.js/blob/master/index.md). I'll be updating it probably everyday. My goal is to learn one pattern a day.
Open Source Universal User Registration System – NodeJS React Redux JWT MongoDB
Tags: reactredux, node, serversiderendering, userregistration
Published: 2018-10-02 13:57:27

---
title: Open Source Universal User Registration System – NodeJS React Redux JWT MongoDB
published: true
description: Open Source Universal User Registration System – NodeJS React Redux JWT MongoDB
tags: react-redux, nodejs, server-side-rendering, user-registration
---

<img src="http://git-assets.react-starter-kit.com/react-redux-registration/react-redux-registration-screenshot.png" />

**[GitHub Repository](https://github.com/simpletut/Universal-React-Redux-Registration)**
**Demo: [Visit the demo](https://react-redux-reg.herokuapp.com/)**
**[View the documentation here](https://simpletut.gitbook.io/universal-react-redux-registration)**



Please note: As the Demo is hosted on a free Heroku account, the servers its hosted on enter ‘sleep mode’ when not in use. If you notice a delay, please allow a few seconds for the servers to wake up.


##### System includes:

Registration, Login, Dashboard, Email Password, Logout

Account Update, 404 (Not Found)

The User Registration System is Fully Responsive out the box and you can Restrict Access to any page!

##### Tech Stack:

* NodeJS
* React
* Server-side Rendered
* Redux
* Redux-Thunk
* Redux-Form
* MongoDB
* Mongoose
* JSON Web Tokens
* Webpack 4
* Babel 7
* Express
* SASS

##### Top Features:

* Async Validation (Redux-Form)
* Winston - Better error handling/logging
* Bcrypt password encryption/verification
* Nodemailer – Custom mail server used to send password reset emails
* Custom ‘Password Reset’ Template (Built with MJML Framework)
* Multiple Layouts – Create unlimited layouts for pages/routes
* Unit Tests
* Toastr - Simple javascript toast notifications
* 100% FREE & Open Source
New Dev
Tags: new, developer
Published: 2018-10-02 12:49:50

---
title: New Dev
published: true
description: Trying to become a developer.
tags: new, developer
---
Hey Everyone!
 Trying out writing a post about my journey into development and what that means for me. I believe I am somewhat of a minority, I am in my 50's and not looking to get a job as a developer at this moment. I am learning mainly because I really enjoy making/building things. I have been a maker my whole life starting with Photography and then moving on to furniture and sculpture building out of wood, metal, and glass. I then moved on to construction for the money. I have always wanted to build things and technology has always interested me thus, here I am. 
 A few years ago I started down the path of learning to code because I saw an Ad that said I could learn to code in 5 minutes! Either I am very slow or they were bending the truth somewhat. I like to think it is the later. I believe I am decent with CSS and HTML but I am still limited with Javascript. I am on the road to learning JS with a few online courses and although slow I think I am progressing. I have used Udemy, YouTube, Wes Bos, and others to learn but the one thing I have a hard time with is motivation. 
 Staying the course for me has been an issue because, as I have mentioned, I am doing this for vanities sake. Lately, I have made this my main focus and I think I will try the 100 days of code giving myself some motivation and accountability. So wish me luck!
How learning modern languages can give you an edge in career
Tags: programming
Published: 2018-10-02 11:52:36

---
title: How learning modern languages can give you an edge in career
published: true
description: In this letter, we talk about how learning modern languages like Dart, Rust can help boost your career
tags: programming
---

![](https://s3.us-east-2.amazonaws.com/devletters/covers/alexa.jpeg)

> First published on [Dev Letters](https://devletters.com/letters/modern-languages-career/)


The new languages coming out these days are amazing, especially when coming from the C's and Java's.

Go is super fast and a pleasure to code in, thanks to its static typing.

Rust has a syntax we all know and love but in bonus, with the speed of C.

Dart is nice too, and thanks to Flutter, we can make beautiful native mobile apps using it. And that too, cross-platform.

But that's not what is most exciting about these languages I just mentioned. There's one more thing - they are more like the no expert zone.

No one knows a lot about these languages (at least if you go by the general population of programmers) so if you learn them, you can stand out.

In fact, this is what I did with my second job. It was late 2016 and very few people knew Golang at that time. So having Golang in my profile turned out to be a big deal. A company contacted me solely based on that when there could have been so many profiles on the side better than me.

Maybe Golang is not that rare now but you get the idea.

For example, Flutter is very new to the world of technology. If you can establish yourself as an expert in Flutter, like make a couple of good 
Flutter apps, write some blog posts, etc, then you have a huge chance of securing your name in this vast developer world, thanks to Flutter.

This works with libraries and toolkits too. For example, the ML Kit recently introduced by Google and the ever-growing Amazon Alexa. 
Do some work in either of these techs, share your experiences and you are automatically regarded as an expert.

It's so obvious I don't know why most people are not doing it. Go find a new technology that you are interested in, and learn the shit out of it. 

Doing this will only help your career.
The treasure behind the castle walls
Published: 2023-06-15 14:29:43

---
title: The treasure behind the castle walls
published: true
date: 2018-10-02 10:00:00 UTC
tags: 
canonical_url: https://nicolas-hoizey.com/articles/2018/10/02/the-treasure-behind-the-castle-walls/
---

> Pile up enough treasure behind the castle walls and you'll eventually attract someone who can climb them.

![A photo of Maciej Ceglowski](https://nicolas-hoizey.com/articles/2018/10/02/the-treasure-behind-the-castle-walls/Maciej-Ceglowski-republica.jpg "Maciej Ceglowski giving a talk at re:publica 2017")

This is a nice quote about security threats caused by concentrating our personal data in a few centralised services, from a great talk [Maciej Ceglowski](https://en.wikipedia.org/wiki/Maciej_Ceg%C5%82owski), founder of [Pinboard](https://nicolas-hoizey.com/tags/pinboard/) (the "social bookmarking site for introverts" [I chose a while ago](https://nicolas-hoizey.com/2014/12/mes-bookmarks-migrent-de-diigo-vers-pinboard.html)), gave at [re:publica](https://re-publica.com/en) in 2017.

Read [the full transcript of the "Notes from an Emergency" talk](http://idlewords.com/talks/notes_from_an_emergency.htm) or see [the video](https://www.youtube.com/watch?v=rSrLjb3k1II):

[https://youtu.be/rSrLjb3k1II](https://youtu.be/rSrLjb3k1II)
ソーシャルゲーム開発経験から学んだゲームにRedisを使う際のTips
Tags: redis, webdev, programming, gamedev
Published: 2018-10-02 08:09:16

---
title: ソーシャルゲーム開発経験から学んだゲームにRedisを使う際のTips
published: true
description: 近年のKVSでは割とRedisが覇権を取っていることもあり(当社比)、社内の多くのプロジェクトでRedisを使用するようになりました。ということでノウハウ的なのも溜まってきたのでまとめてみます。
tags: #redis, #webdev, #programming, #gamedev
---

本稿は「[ソシャゲ開発経験から学んだゲームに Redis を使う際の Tips](https://qiita.com/ta_ta_ta_miya/items/0c50e169b5ed58aaf26b)」をもとに加筆・補正し、文章を整えました。

近年のKVSでは割とRedisが覇権を取っていることもあり(当社比)、社内の多くのプロジェクトでRedisを使用するようになりました。ということでノウハウ的なのも溜まってきたのでまとめてみます(大量のユーザーデータを扱うソーシャルゲームにしか当てはまらない部分もあるかと思います)。

# 単純にパフォーマンスをRDB < Redisと思い込んでとりあえずでキャッシュしない
「Redisは速い」と言われますが、インデックスをきちんと貼ったRDBのクエリもそこまで遅いわけではありません。結局通信コストの方が遥かに大きいので、内部の取得時間差はトータルで考えると多くの場合誤差です。特にRDBの主キーのみで取得できるようなデータを、Redisにキャッシュすることにメリットはありません。キャッシュするコードを書くコストの方が高くつきます。キャッシュするのは、RDBの複数テーブルを参照しなければならないような、時間のかかるかつアクセス頻度が高いクエリに対して行いましょう。

# 基本的にExpireはつける
Redisはデータを永続化できることも特徴ですが、逆に言えば消えないためディスク容量はどんどん圧迫されていきます。永続性が必要ないものについては、Expireをつけることにより、ディスクが食いつぶされるのを幾分か防ぐことができます。とくに、キャッシュの場合は必須です。

# そもそも容量を圧迫しないように設計する
Expireはあくまで有効期限なので、短期間に大量アクセスが来れば、データ設計によってはやはり容量不足になることもあります。ですから、そうそうデータが爆発しないように設計しておきましょう。ユーザーが何かアクションするたびにレコード増えるような設計は厳禁です(ユーザーがクエストに行くたびに1レコード増えるなど)。

基本的にユーザーと機能に対してデータ量が1:1になるようにしておけば、データ量が一気に増加しにくいですし、データ量の把握もしやすいです(少し前のゲームによく見られた「1日1回フレンドにあいさつする」という機能で、1あいさつ1レコードつくったためにKVSの容量が膨大になった、という事例があったそうです)。

# 永続データ

## RedisとRDBのデータを同時一括更新しないようにする
RedisのデータとRDBのデータの同時更新でエラーが起きた場合、RDBのデータはトランザクションに守られていますが、Redisのデータは手動ロールバックが必要になります。実装的にもメンテナンス性もよくないので極力避けるべきです。

そもそもエラー時にロールバックしなければならないようなデータは、Redisに入れるのを避けるべきかもしれません。エラーが出たらそのデータは一旦削除、くらいの気軽さがあった方がいろいろ楽です。

## Redisにユーザーの永続データを入れるのを避ける
前項目に若干関係しますが、ユーザーの永続データは入れない方がいいです。ユーザー数は広告効果等である日大量に増加したりするので、思わぬところで負債が産まれたりします(RDBの負荷分散はバッチリだったけどRedisの負荷分散は考えてなかった！とか。負荷分散するにはデータを一旦消さなきゃ！でもユーザーデータだから消せない！とか)

そもそもRDBがあるのに、わざわざRedisを永続データの保存先に使う必要は基本的にないはずです(でもちょっとしたパラメータが、気づいたらなぜかRedisのみに保存されるようになってたりします。~~git blameしなきゃ~~)。

ユーザーデータでない永続データは設定系でしょうか...(例が出ません)。ユーザーデータ以外なら、開発側である程度データ量の制御ができるので、便利に使えるなら使ってもよいかと思います。

# ゲームにおけるRedisの使い所

## キャッシュ
KVSなのでキャッシュが一番に思いつきますが、前述のとおりキャッシュ対象は吟味しましょう。もちろんExpire必須！あと、負荷が高いときはスケールアウトできるようにしておくといいです。Redisはスケールアップよりスケールアウトの方が効果が高い気がします(シングルスレッドだからか、コア数など増やしても、そこまでパフォーマンスは上がらなかった経験があります)。各言語のRedisライブラリも割とシャーディング対応しています。大体がキーのハッシュ値から各シャードに振り分ける実装になっているため、キャッシュサーバーの増減もしやすいです。

## ランキング
ソート済みセットを使ったランキング実装はRedisの有効な使い方です。各ユーザーのポイントはDBに保存してあるはずなので、何かあったらランキングは集計し直せばいいだけという点もgood!(~~同点問題は管轄外です~~)

## レイド(みんなでボスを殴るやつ)
複数ユーザーで一体のボスを倒すようなものは、ボスの体力減少のレースコンディションがやっかいですが、Redisのincrby、decrbyはアトミックなためみんなで一斉に殴っても大丈夫です(やったぜ)。

# 最後に
以上になります。Redisは便利ですがデータの保存先としてはRDBに寄せた方が運用しやすいです。Redisの中身は吹っ飛んでも最悪作り直せばOKという設計にしておくと精神的に楽です(別にRedisのデータが吹っ飛びやすいとか言ってるのではなく、死守しなければならないものが多いと大変ということです)。
Ecto 3.0: 互換性を破る変更予定について
Tags: elixir, webdev, progarmming, tutorial
Published: 2018-10-02 07:56:54

---
title: Ecto 3.0: 互換性を破る変更予定について
published: true
description: Ecto 3.0のリリースが近づいてきました。本稿はplataformatec社の許諾を得て、plataformatec社開発チームのblog記事「A sneak peek at Ecto 3.0 - breaking changes」から、内容をかいつまんでご紹介します。3.0というメジャーバージョンのアップデートではあるものの、後方互換性を破る変更は、おもにつぎの3つの領域に絞られるようです。
tags: #elixir, #webdev, #progarmming, #tutorial
---

Ecto 3.0のリリースが近づいてきました。本稿はplataformatec社の許諾を得て、開発チームのblog記事「[A sneak peek at Ecto 3.0: breaking changes](http://blog.plataformatec.com.br/2018/10/a-sneak-peek-at-ecto-3-0-breaking-changes/)」から、内容をかいつまんでご紹介します。3.0というメジャーバージョンのアップデートではあるものの、後方互換性を破る変更は、おもにつぎの3つの領域に絞られるようです。

- Ectoリポジトリの分離
- 非推奨だったEcto datetime型を除き、Elixirに備わるCalendar型に替える
- JSONの扱いを最適な手法に改める

今回は、後方互換性に関わる注意点についてご説明します。新機能やパフォーマンスの改善については、のちの同社blog記事で紹介されるでしょう。


# Ectoリポジトリをectoとecto_sqlに分ける
Ecto 3.0は`ecto`と`ecto_sql`のふたつのリポジトリに分けられます。Ecto 2.0から開発者とチームの数は増え、デーベースはなしにデータマッピングと検証に使われてきました。けれど、アプリケーションにEctoを用いると、SQLに関わるアダプタやサンドボックスあるいはデータの移行などが混在するようになりました。

Ecto 3.0ではすべてのSQLアダプタは別のリポジトリに移し、Ectoは、スキーマ、チェンジセット、クエリ、リポジトリの4つの構成要素に焦点を当てます。

EctoをSQLデータベースで使っているなら、Ecto 3.0への移行はとても簡単です。これまでの記述はつぎのようでした。

```
{:ecto, “~> 2.2”}

```

これを以下に書き替えてください。

```
{:ecto_sql, “~> 3.0”}

```

Ectoをデータの操作だけに使っていてデータベースへのアクセスがなければ、バージョンの変更だけで済みます。


# Calendar型
`Ecto.Date`と`Ecto.Time`および`Ecto.DateTime`はなくなります。替わりに、`Date`と`Time`そして`DateTime`および`NaiveDateTime`をお使いください。Elixirに備わっていて、Ecto 2.1から推奨されてきた型です。すでに非推奨の型でなく、これら新しい型を使っていれば問題ありません。

この機会に、すべてのデータベースでマイクロ秒をサポートするように統合しました。`:time`と`:naive_datetime`および`:utc_datetime`型は、マイクロ秒の情報はもちません。Ecto 3.0はマイクロ秒を保持する`:time_usec`と`:naive_datetime_usec`および`:utc_datetime_usec`型を採り入れました。移行とスキーマにマイクロ秒を保ちたいときは、リポジトリの設定が必要です。

```
config :my_app, MyApp.Repo,
migration_timestamps: [type: :naive_datetime_usec]
```

また、スキーマはつぎのとおりです。

```
@timestamps_opts [type: :naive_datetime_usec]
```

データベースアダプタもElixirの型で動作するように標準化されています。開発でロークエリを実行したとき、タプルは返されませんのでご注意ください。


# JSONの処理
Ecto 3.0はJSONライブラリの管理をアダプタに移しました。すべてのアダプタはJSONがデフォルトです。

つぎの設定は警告が示されますので、以下のように書き替えてください。

```
config :ecto, :json_library, CustomJSONLib
```

### Postgres
```
config :postgrex, :json_library, CustomJSONLib
```

### MySQL
```
config :mariaex, :json_library, CustomJSONLib
```

Poisonにロールバックするには、アダプタをつぎのように設定します。

### Postgres
```
config :postgrex, :json_library, Poison
```

### MySQL
```
config :mariaex, :json_library, Poison
```

ただし、JSONへの移行が推奨されます。Poisonのビルトインサポートは、将来のEcto 3.xのリリースで除かれるでしょう。


# その他の変更
データ型が統一されましたので、`Ecto.DataType`プロトコルは要らなくなり、除かれました。このプロトコルを実装していた場合、削除すれば問題なく動作します。

`Ecto.Multi.run/5`はrepoモジュールを受け取るように改善されました。トランザクションは第1引数で実行されます。したがって、`module-function-args`はどの`Ecto.Multi`関数にも渡せます。最初の引数としてrepoを受け取るように書き替えてください。この変更により、クリーンで結合の少ないコードが書けるでしょう。

この後のblog記事では、Ecto 3.0の接頭辞(prefix)サポート(PostgreSQLのいゆわるschemas)が採り上げられるでしょう。これまでは、クエリ全体に対してのみ定めることができました。Ecto 3.0では細かく設定できるようになります。スキーマで`@schema_prefix`属性を与えてあれば、影響はそのスキーマのみで、全体には及びません。


#### 関連記事
- [Ecto 3.0: クエリーAPIの改善を予定[前編]](https://dev.to/gumi/ecto-30-api-d0g)
- [Ecto 3.0: クエリーAPIの改善を予定[後編]](https://dev.to/gumi/ecto-30-api-3odk)
- [Ecto 3.0: パフォーマンスと新バージョンへの移行など](https://dev.to/gumi/ecto-30--3ema)