Maps and tuples are useful data types for modeling relational operations. For example, suppose we have the following table, indexed by the Id column: | Id | First Name | Last Name | |----|------------|-----------| | 0 | Gabriel | Gonzalez | | 1 | Oscar | Boykin | | 2 | Edgar | Codd | We can model that as a Map where the key is the Id column and the value is a tuple of FirstName and LastName: impor
SQLite: Small. Fast. Reliable. Choose any three. July 14, 2014 12:37 / berkeleydb peewee python sqlite / 10 comments SQLite is a fantastic database and in this post I'd like to explain why I think that, for many scenarios, SQLite is actually a great choice. I hope to also clear up some common misconceptions about SQLite. Concurrency As the maintainer of an ORM, I get asked a lot of questions about
最近 Yesod を弄っているが、Yesod で使ってるやつ (Database.Persistent) を使って、普通に DB 操作したいな、と。 sqlite と mongodb をやってみる。 github にあげた分 → https://github.com/rf0444/haskell-db とりあえず自分の環境 (Mac) で runhaskell で確認した。 cabal はめんどそうなのでまた今度。 sqlite 編 Yesod の Persistent の通りにやればまあ動く。 構成を Yesod のプロジェクトっぽくしたかったので、yesod init した後の Model.hs を持ってきて、Yesod 関係のものを書き換える。 {-# LANGUAGE TypeFamilies, TemplateHaskell, FlexibleContexts, GADTs #-
HaskellでDBを操作するならHDBCを使うのが定石だとは思うんですが、やりたいことが簡単でかつSQLiteで十分だったので、Database.SQLiteを使ってみました。 使い方 SQL文を発行する 最初にsqlite3本体と、cabalでsqliteパッケージをインストールする必要があります。 使い方は簡単で、openConnectionで接続で開き、execStatementでSQL文を発行して、結果を取得します。execStatementの返値は多相で、Either String [[Row String]] 、Either String [[Row Value]]、Either String [[Row Value]]のいずれかを選べます。 Either String [[Row String]] ならLeftがエラーで、Rightなら列名と値のタプルのリストのリストのリス
軽量・高速なデータベースSQLiteをPythonから扱うためのライブラリ。 インストール Python2.5から標準ライブラリに入りました。 インストール作業は不要です。 使用方法 sqlite3をインポートする #!python2.6 # -*- coding: utf-8 -*- import sqlite3 データベースを作成する con = sqlite3.connect("data.db") ファイルがすでに存在するときはファイルを開く。 ファイルがないときは新しいデータベースを作成する。 isolation_levelにNoneを指定すると、自動コミットモードになります。 con = sqlite3.connect('temp.db', isolation_level=None) 特別な名前である ":memory:" を使うとRAM上にデータベースを作ることもできます。 c
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く