Skip to content

Commit

Permalink
Merge commit 'c632ac480e6fffc79c32845a34488574fc5bc685'
Browse files Browse the repository at this point in the history
Conflicts:
	Makefile
	README.md
	mongo_fdw.c
	mongo_query.c
truongsinh committed Sep 24, 2014
2 parents f4f6c42 + c632ac4 commit 9b66014
Showing 76 changed files with 399 additions and 13,887 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -20,8 +20,10 @@

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# pgregress results directory
results/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "mongo-c-driver"]
path = mongo-c-driver
url = ../../mongodb/mongo-c-driver.git
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -13,16 +13,21 @@ MODULE_big = mongo_fdw
# environment object file.
#

MONGO_DRIVER = mongo-c-driver-v0.6
MONGO_DRIVER = mongo-c-driver
MONGO_PATH = $(MONGO_DRIVER)/src
MONGO_OBJS = $(MONGO_PATH)/bson.os $(MONGO_PATH)/encoding.os $(MONGO_PATH)/md5.os $(MONGO_PATH)/mongo.os $(MONGO_PATH)/numbers.os $(MONGO_PATH)/env_posix.os
MONGO_OBJS = $(MONGO_PATH)/bson.os $(MONGO_PATH)/encoding.os $(MONGO_PATH)/md5.os \
$(MONGO_PATH)/mongo.os $(MONGO_PATH)/numbers.os $(MONGO_PATH)/env.os

PG_CPPFLAGS = --std=c99 -I$(MONGO_PATH)
OBJS = connection.o option.o mongo_wrapper.o mongo_fdw.o mongo_query.o $(MONGO_OBJS)

EXTENSION = mongo_fdw
DATA = mongo_fdw--1.0.sql

REGRESS = mongo_fdw
REGRESS_OPTS = --inputdir=test --outputdir=test \
--load-extension=$(EXTENSION)

$(MONGO_DRIVER)/%.os:
$(MAKE) -C $(MONGO_DRIVER) $*.os

44 changes: 0 additions & 44 deletions Makefile.legacy

This file was deleted.

111 changes: 9 additions & 102 deletions README.md
Original file line number Diff line number Diff line change
@@ -7,113 +7,20 @@ PostgreSQL Version **9.3** and greater.

## 1 - Installation

This [MongoDB][1] Foreign Data Wrapper is compatible with two [MongoDB][1]'s 'C' drivers, [MongoDB's Legacy C driver][6] and [MongoDB's C Driver][7]. [MongoDB][1]'s driver to use is decided at compile time using a different Makefile.
The MongoDB FDW depends on the official MongoDB C Driver version 0.8 and
includes it as a git submodule. If you are cloning this repository for the
first time, be sure to pass the --recursive option to git clone in order to
initialize the driver submodule to a useable
state.

### 1.1 - Compiling Using 'Legacy C' Driver###
If have checked out this project before and for some reason your submodule is
not up-to-date, run git submodule update --init.

The [MongoDB][1]'s FDW includes the source code of [MongoDB's Legacy C Driver][6] version **0.6**.

1 - Export `pg_config` Path

To build on POSIX-compliant systems (like Linux and OS X), you require to ascertain
that `pg_config` executable is in your path when you run make. This executable is typically in your PostgreSQL installation's bin directory.

```sh
# export PATH=/usr/local/pgsql/bin:$PATH
```

2 - Compile code

```sh
# make
```

OR

```sh
# make -f Makefile.legacy
```

*Note: [MongoDB's Legacy C driver][6] will be compiled automatically.*

3 - Install

```sh
# make install
```
OR

```sh
# make -f Makefile.legacy install
```

### 1.2 - Compile Using [MongoDB][7]'s C Driver

The source code of [MongoDB's C Driver][7] is not part of this repository. It can be downloaded from

https://github.com/mongodb/mongo-c-driver


#### 1.2.1 - Install MongoDB's C Driver

1 - Download [MongoDB's C Driver][7]

```sh
git clone https://github.com/mongodb/mongo-c-driver.git mongo-c-meta-driver
```

2 - Change directory

```sh
cd mongo-c-meta-driver
```

3 - Configure Driver

```sh
./autogen.sh
```

4 - Compile Driver

```sh
make
```

5 - Install Driver

```sh
make install
```
When you type `make`, the C driver's source code also gets automatically
compiled and linked.

*Note: Make sure you have permission to "/usr/local" (default installation location) folder.*

#### 1.2.2 - Install Foreign Data Wrapper

1 - Change configuration

Add `#deine META_DRIVER` in `config.h` file

1 - Export `pg_config` Path

To build on POSIX-compliant systems (like Linux and OS X), you require to ascertain
that `pg_config` executable is in your path when you run make. This executable is typically in your PostgreSQL installation's bin directory.

```sh
# export PATH=/usr/local/pgsql/bin:$PATH
```

2 - Compile code

```sh
# make -f Makefile.meta
```
2 - Install

```sh
# make -f Makefile.meta install
```

*Note that we have verified the `mongo_fdw` extension only on MacOS X, Fedora and Ubuntu
systems. If you run into issues on other systems, please [let us know][3]*

1 change: 1 addition & 0 deletions mongo-c-driver
Submodule mongo-c-driver added at 8f27c0
4 changes: 0 additions & 4 deletions mongo-c-driver-v0.6/.astylerc

This file was deleted.

26 changes: 0 additions & 26 deletions mongo-c-driver-v0.6/.gitignore

This file was deleted.

202 changes: 0 additions & 202 deletions mongo-c-driver-v0.6/APACHE-2.0.txt

This file was deleted.

201 changes: 0 additions & 201 deletions mongo-c-driver-v0.6/HISTORY.md

This file was deleted.

199 changes: 0 additions & 199 deletions mongo-c-driver-v0.6/Makefile

This file was deleted.

66 changes: 0 additions & 66 deletions mongo-c-driver-v0.6/README.md

This file was deleted.

297 changes: 0 additions & 297 deletions mongo-c-driver-v0.6/SConstruct

This file was deleted.

21 changes: 0 additions & 21 deletions mongo-c-driver-v0.6/check_int64.sh

This file was deleted.

56 changes: 0 additions & 56 deletions mongo-c-driver-v0.6/docs/buildscripts/docs.py

This file was deleted.

113 changes: 0 additions & 113 deletions mongo-c-driver-v0.6/docs/examples/example.c

This file was deleted.

130 changes: 0 additions & 130 deletions mongo-c-driver-v0.6/docs/source/sphinx/Makefile

This file was deleted.

155 changes: 0 additions & 155 deletions mongo-c-driver-v0.6/docs/source/sphinx/make.bat

This file was deleted.

218 changes: 0 additions & 218 deletions mongo-c-driver-v0.6/docs/source/sphinx/source/bson.rst

This file was deleted.

233 changes: 0 additions & 233 deletions mongo-c-driver-v0.6/docs/source/sphinx/source/building.rst

This file was deleted.

216 changes: 0 additions & 216 deletions mongo-c-driver-v0.6/docs/source/sphinx/source/conf.py

This file was deleted.

149 changes: 0 additions & 149 deletions mongo-c-driver-v0.6/docs/source/sphinx/source/connections.rst

This file was deleted.

73 changes: 0 additions & 73 deletions mongo-c-driver-v0.6/docs/source/sphinx/source/errors.rst

This file was deleted.

46 changes: 0 additions & 46 deletions mongo-c-driver-v0.6/docs/source/sphinx/source/index.rst

This file was deleted.

401 changes: 0 additions & 401 deletions mongo-c-driver-v0.6/docs/source/sphinx/source/tutorial.rst

This file was deleted.

106 changes: 0 additions & 106 deletions mongo-c-driver-v0.6/docs/source/sphinx/source/write_concern.rst

This file was deleted.

316 changes: 0 additions & 316 deletions mongo-c-driver-v0.6/doxygenConfig

This file was deleted.

44 changes: 0 additions & 44 deletions mongo-c-driver-v0.6/runtests.sh

This file was deleted.

Loading

0 comments on commit 9b66014

Please sign in to comment.