Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
86b9134b
milvus
项目概览
BaiXuePrincess
/
milvus
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
86b9134b
编写于
3月 20, 2019
作者:
X
xj.lin
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of 192.168.1.105:jinhai/vecwise_engine into develop
上级
cdc28432
7d8c2b14
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
53 addition
and
3 deletion
+53
-3
README.md
README.md
+17
-0
pyengine/engine/__init__.py
pyengine/engine/__init__.py
+2
-1
pyengine/engine/model/FileTable.py
pyengine/engine/model/FileTable.py
+18
-0
pyengine/engine/model/GroupTable.py
pyengine/engine/model/GroupTable.py
+14
-0
pyengine/engine/settings.py
pyengine/engine/settings.py
+2
-2
未找到文件。
README.md
浏览文件 @
86b9134b
...
...
@@ -8,3 +8,20 @@
-
`conda install faiss-gpu cuda90 -c pytorch # For CUDA9.0`
-
`conda install flask`
-
`pip install flask-restful`
### Create Database
-
Install MySQL
-
`sudo apt-get update`
-
`sudo apt-get install mariadb-server`
-
Create user and database:
-
`create user vecwise;`
-
`create database vecdata;`
-
`grant all privileges on vecdata.* to 'vecwise'@'%';`
-
`flush privileges;`
-
Create table:
-
`python`
# enter python3 interaction environment
-
`from engine import db`
-
`db.create_all()`
pyengine/engine/__init__.py
浏览文件 @
86b9134b
...
...
@@ -10,6 +10,7 @@ app.config.from_object('engine.settings')
print
(
"Create database instance"
)
db
=
SQLAlchemy
(
app
)
from
engine.model.IndexTable
import
IndexTable
from
engine.model.GroupTable
import
GroupTable
from
engine.model.FileTable
import
FileTable
from
engine.controller
import
IndexManage
pyengine/engine/model/
Index
Table.py
→
pyengine/engine/model/
File
Table.py
浏览文件 @
86b9134b
from
engine
import
db
class
Index
Table
(
db
.
Model
):
__tablename__
=
'
index
_table'
class
File
Table
(
db
.
Model
):
__tablename__
=
'
file
_table'
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
)
table
name
=
db
.
Column
(
db
.
String
(
100
))
group_
name
=
db
.
Column
(
db
.
String
(
100
))
filename
=
db
.
Column
(
db
.
String
(
100
))
type
=
(
db
.
Integer
)
row_number
=
db
.
Column
(
db
.
Integer
)
def
__init__
(
self
,
table
name
,
filename
,
type
):
self
.
tablename
=
table
name
def
__init__
(
self
,
group_
name
,
filename
,
type
):
self
.
group_name
=
group_
name
self
.
filename
=
filename
self
.
type
=
type
self
.
row_number
=
0
def
__repr__
(
self
):
return
'<IndexTable $r>'
%
self
.
tablename
\ No newline at end of file
return
'<FileTable $r>'
%
self
.
tablename
\ No newline at end of file
pyengine/engine/model/GroupTable.py
0 → 100644
浏览文件 @
86b9134b
from
engine
import
db
class
GroupTable
(
db
.
Model
):
__tablename__
=
'group_table'
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
)
group_name
=
db
.
Column
(
db
.
String
(
100
))
file_number
=
db
.
Column
(
db
.
Integer
)
def
__init__
(
self
,
group_name
):
self
.
group_name
=
group_name
self
.
file_number
=
0
def
__repr__
(
self
):
return
'<GroupTable $r>'
%
self
.
group_name
\ No newline at end of file
pyengine/engine/settings.py
浏览文件 @
86b9134b
...
...
@@ -2,5 +2,5 @@
DEBUG
=
True
SQLALCHEMY_TRACK_MODIFICATIONS
=
False
SECRET_KEY
=
'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'
SQLALCHEMY_DATABASE_URI
=
"mysql://user:passwd@ip:port/BLOG_DB"
\ No newline at end of file
# SECRET_KEY='A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'
SQLALCHEMY_DATABASE_URI
=
"mysql+pymysql://vecwise@127.0.0.1:3306/vecdata"
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录