# How to (row) append two JuliaDB tables together?

**URL:** https://discourse.julialang.org/t/how-to-row-append-two-juliadb-tables-together/14228
**Category:** Data
**Created:** [August 29, 2018, 6:35am UTC](https://discourse.julialang.org/t/how-to-row-append-two-juliadb-tables-together/14228 "2018-08-29T06:35:56Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)
#### Post date: [August 29, 2018, 6:35am UTC](https://discourse.julialang.org/t/how-to-row-append-two-juliadb-tables-together/14228/1 "2018-08-29T06:35:57Z")

</div>

How do I (row) append two JuliaDB tables togehter?

In DataFrames.jl `[data1;data2]` is sufficient, but the same syntax doesn’t work in JuliaDB. Also How do I append table 2 to table 1 by modifying table 1?

See MWE

```julia
using DataFrames, IterableTables, JuliaDB

df = DataFrame([[1:3...],[4:6...]],[:a,:b])
df1 = DataFrame([[1:3...],[4:6...]],[:a,:b])

[df;df1] # works

rs_db = table(df)
rs_db1 = table(df)

[rs_db;rs_db1] # doesn't works

```

---

<div class="post-metadata">

### Author: ![piever](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/piever/32/1815_2.png) [@piever](https://discourse.julialang.org/u/piever)
#### Post date: [August 29, 2018, 9:11am UTC](https://discourse.julialang.org/t/how-to-row-append-two-juliadb-tables-together/14228/2 "2018-08-29T09:11:45Z")

</div>

`merge(rs_db, rs_db1)`

IndexedTables can have primary keys and appending them may not respect those which is why is not implemented ATM. OTOH, `rows(rs_db)` behaves pretty much like an `Array` of `NamedTuple`, so any sensible `Array` operation work on it. For example:

```julia

julia> append!(rows(rs_db), rows(rs_db1))
6-element IndexedTables.Columns{NamedTuples._NT_a_b{Int64,Int64},NamedTuples._NT_a_b{Array{Int64,1},Array{Int64,1}}}:
 (a = 1, b = 4)
 (a = 2, b = 5)
 (a = 3, b = 6)
 (a = 1, b = 4)
 (a = 2, b = 5)
 (a = 3, b = 6)

```
