Skip to content

Commit 0830ae7

Browse files
authored
Cleanup docs and fix #139 by documenting createtable (#197)
1 parent adf8fc2 commit 0830ae7

File tree

8 files changed

+123
-67
lines changed

8 files changed

+123
-67
lines changed

.travis.yml

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,23 @@
1-
before_install:
2-
- cd ../..
3-
- mv $TRAVIS_REPO_SLUG _old
4-
- git config --global core.autocrlf false
5-
- git clone --depth=50 _old $TRAVIS_REPO_SLUG
6-
- cd $TRAVIS_REPO_SLUG
7-
1+
# Documentation: http://docs.travis-ci.com/user/languages/julia/
82
language: julia
9-
10-
sudo: false
11-
123
os:
134
- linux
145
- osx
156
- windows
16-
177
arch:
188
- x64
199
- x86
20-
2110
julia:
2211
- 1.0
2312
- 1.3
2413
- nightly
25-
26-
env:
27-
- JULIA_PROJECT="@."
28-
2914
matrix:
15+
allow_failures:
16+
- julia: nightly
17+
fast_finish: true
3018
exclude:
3119
- os: osx
3220
arch: x86
33-
allow_failures:
34-
- julia: nightly
35-
36-
notifications:
37-
email: false
38-
39-
after_success:
40-
- julia -e 'ENV["TRAVIS_JULIA_VERSION"] == "1.3" && ENV["TRAVIS_OS_NAME"] != "linux" && exit(); using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
41-
42-
jobs:
4321
include:
4422
- stage: "Documentation"
4523
julia: 1.3
@@ -48,3 +26,7 @@ jobs:
4826
- julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.build("SQLite")'
4927
- julia --project=docs/ docs/make.jl
5028
after_success: skip
29+
notifications:
30+
email: false
31+
after_success:
32+
- julia -e 'ENV["TRAVIS_JULIA_VERSION"] == "1.3" && ENV["TRAVIS_OS_NAME"] != "linux" && exit(); using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'

docs/.documenter.enc

-1.64 KB
Binary file not shown.

docs/Manifest.toml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# This file is machine-generated - editing it directly is not advised
2+
3+
[[Base64]]
4+
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
5+
6+
[[Dates]]
7+
deps = ["Printf"]
8+
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
9+
10+
[[Distributed]]
11+
deps = ["Random", "Serialization", "Sockets"]
12+
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
13+
14+
[[DocStringExtensions]]
15+
deps = ["LibGit2", "Markdown", "Pkg", "Test"]
16+
git-tree-sha1 = "88bb0edb352b16608036faadcc071adda068582a"
17+
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
18+
version = "0.8.1"
19+
20+
[[Documenter]]
21+
deps = ["Base64", "DocStringExtensions", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"]
22+
git-tree-sha1 = "d45c163c7a3ae293c15361acc52882c0f853f97c"
23+
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
24+
version = "0.23.4"
25+
26+
[[InteractiveUtils]]
27+
deps = ["Markdown"]
28+
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
29+
30+
[[JSON]]
31+
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
32+
git-tree-sha1 = "b34d7cef7b337321e97d22242c3c2b91f476748e"
33+
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
34+
version = "0.21.0"
35+
36+
[[LibGit2]]
37+
deps = ["Printf"]
38+
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
39+
40+
[[Libdl]]
41+
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
42+
43+
[[Logging]]
44+
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
45+
46+
[[Markdown]]
47+
deps = ["Base64"]
48+
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
49+
50+
[[Mmap]]
51+
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
52+
53+
[[Parsers]]
54+
deps = ["Dates", "Test"]
55+
git-tree-sha1 = "c56ecb484f286639f161e712b8311f5ab77e8d32"
56+
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
57+
version = "0.3.8"
58+
59+
[[Pkg]]
60+
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
61+
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
62+
63+
[[Printf]]
64+
deps = ["Unicode"]
65+
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
66+
67+
[[REPL]]
68+
deps = ["InteractiveUtils", "Markdown", "Sockets"]
69+
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
70+
71+
[[Random]]
72+
deps = ["Serialization"]
73+
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
74+
75+
[[SHA]]
76+
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
77+
78+
[[Serialization]]
79+
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
80+
81+
[[Sockets]]
82+
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
83+
84+
[[Test]]
85+
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
86+
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
87+
88+
[[UUIDs]]
89+
deps = ["Random", "SHA"]
90+
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
91+
92+
[[Unicode]]
93+
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

docs/Project.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3-
SQLite = "0aa819cd-b072-5ff4-a722-6bc24af294d9"
4-
5-
[compat]
6-
Documenter = "~0.22"

docs/make.jl

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
using Documenter, SQLite
22

3-
makedocs(
4-
modules = [SQLite],
5-
sitename = "SQLite.jl",
6-
pages = ["Home" => "index.md"]
3+
makedocs(;
4+
modules=[SQLite],
5+
format=Documenter.HTML(),
6+
pages=[
7+
"Home" => "index.md",
8+
],
9+
repo="https://github.com/JuliaDatabases/SQLite.jl/blob/{commit}{path}#L{line}",
10+
sitename="SQLite.jl",
11+
authors="Jacob Quinn",
12+
assets=String[],
713
)
814

9-
deploydocs(
10-
repo = "github.com/JuliaDatabases/SQLite.jl.git",
11-
target = "build",
15+
deploydocs(;
16+
repo="github.com/JuliaDatabases/SQLite.jl",
1217
)

docs/mkdocs.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/src/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ SQLite.DB
1616
SQLite.Stmt
1717
SQLite.bind!
1818
SQLite.execute!
19+
SQLite.createtable!
1920
SQLite.drop!
2021
SQLite.dropindex!
2122
SQLite.createindex!

src/tables.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,15 @@ function Query(db::DB, sql::AbstractString; values=[], stricttypes::Bool=true, n
116116
return Query(stmt, Ref(status), header, types, Dict(x=>i for (i, x) in enumerate(header)))
117117
end
118118

119-
# as a sink
119+
"""
120+
SQLite.createtable!(db::SQLite.DB, table_name, schema::Tables.Schema; temp=false, ifnotexists=true)
121+
122+
Create a table in `db` with name `table_name`, according to `schema`, which is a set of column names and types, constructed like `Tables.Schema(names, types)`
123+
where `names` can be a vector or tuple of String/Symbol column names, and `types` is a vector or tuple of sqlite-compatible types (`Int`, `Float64`, `String`, or unions of `Missing`).
124+
125+
If `temp=true`, the table will be created temporarily, which means it will be deleted when the `db` is closed.
126+
If `ifnotexists=true`, no error will be thrown if the table already exists.
127+
"""
120128
function createtable!(db::DB, nm::AbstractString, ::Tables.Schema{names, types}; temp::Bool=false, ifnotexists::Bool=true) where {names, types}
121129
temp = temp ? "TEMP" : ""
122130
ifnotexists = ifnotexists ? "IF NOT EXISTS" : ""

0 commit comments

Comments
 (0)