Code Monkey home page Code Monkey logo

Comments (20)

yann0917 avatar yann0917 commented on May 18, 2024 2

我 fork 了一份,大改了作者源码,新增了输出 Markdown, json, txt, csv格式,导出数据字典很方便:https://github.com/yann0917/fuckdb

输出 markdown 格式举例(符合我公司的数据字典格式,使用 hugo 生成静态页面):


title: common_config - 公共的配置
weight: 100

结构

字段 数据类型 索引 默认值 备注
id int(11) unsigned PRI 主键ID
keyword varchar(64) 关键词
value text
type tinyint(1) 0 是否需要jwt验证
remark varchar(255) 描述
created_at timestamp 创建时间
updated_at timestamp CURRENT_TIMESTAMP 更新时间
deleted_at timestamp 删除时间

SQL

CREATE TABLE `common_config` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `keyword` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '关键词',
  `value` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '',
  `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否需要jwt验证',
  `remark` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '描述',
  `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted_at` timestamp NULL DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='公共的配置'

updateSQL

from fuckdb.

hantmac avatar hantmac commented on May 18, 2024

hi,如题,输出的struct中的字段按字母排序而不是数据库的字段顺序。
是我的设置问题么,还是可以优化下?

目前确实是按照字母顺序排序的,我看看能否优化一下。Thanks!

from fuckdb.

hantmac avatar hantmac commented on May 18, 2024

已经 fix 了,执行 brew uninstall fuckdb && brew tap hantmac/tap && brew install fuckdb 升级到最新版本就可以指定 struct 字段的顺序了,默认按照数据库顺序 🍺

from fuckdb.

hantmac avatar hantmac commented on May 18, 2024

@beijibeijing 有时间的话帮忙验证下哈,没什么问题我就 close issue

from fuckdb.

beijibeijing avatar beijibeijing commented on May 18, 2024

更新中,待会测下,另外问个问题,注释不能一起导出来么?

from fuckdb.

hantmac avatar hantmac commented on May 18, 2024

@beijibeijing 是指数据库的注释(comment)吗?

from fuckdb.

beijibeijing avatar beijibeijing commented on May 18, 2024

没用brew安装直接clone下来,前端build了下然后go环境里跑的,还是按字母排序啊;
是的数据库的注释(comment)。
辛苦~

from fuckdb.

hantmac avatar hantmac commented on May 18, 2024
  1. 拉最新的代码试一下;
  2. struct 里包含数据库的 comment 感觉没什么用呀?这个 comment 你是想要放在 struct 代码的哪个位置?

from fuckdb.

beijibeijing avatar beijibeijing commented on May 18, 2024

2.放到//后面。。。。。。。只看代码的代码同学,就知道啥意思了啊,不用去数据库或者另看文档了

from fuckdb.

hantmac avatar hantmac commented on May 18, 2024

有道理,周末有时间看看这个问题;

ps: 我感觉命令行更加灵活,可以试下命令行

from fuckdb.

hantmac avatar hantmac commented on May 18, 2024

@yann0917 哇看起来很棒,方便的话可以贡献这些代码吗?我想在命令行里也支持生成这些格式。

from fuckdb.

yann0917 avatar yann0917 commented on May 18, 2024

@yann0917 哇看起来很棒,方便的话可以贡献这些代码吗?我想在命令行里也支持生成这些格式。

完全可以啊,我提 PR 吗?

from fuckdb.

hantmac avatar hantmac commented on May 18, 2024

@yann0917 哇看起来很棒,方便的话可以贡献这些代码吗?我想在命令行里也支持生成这些格式。

完全可以啊,我提 PR 吗?

没问题的,来吧 😄

from fuckdb.

yann0917 avatar yann0917 commented on May 18, 2024

@yann0917 哇看起来很棒,方便的话可以贡献这些代码吗?我想在命令行里也支持生成这些格式。

完全可以啊,我提 PR 吗?

没问题的,来吧 😄

我改动太大了,完全冲突了,没法提 PR 😭
image

from fuckdb.

hantmac avatar hantmac commented on May 18, 2024

@yann0917 确实是,不然就重新 fork ,然后再写一遍,然后按功能提交?或者我看下你代码,我来加也行🤔

from fuckdb.

yann0917 avatar yann0917 commented on May 18, 2024

@yann0917 确实是,不然就重新 fork ,然后再写一遍,然后按功能提交?或者我看下你代码,我来加也行🤔

我重新建了个develop 分支,这个分支合并了冲突,但是把你 master 的分支回滚到了 5月14号🤔 ,web 页面的功能应该是完全兼容的,命令行的我用不到,就没重构这部分(应该有错),你看下。

from fuckdb.

hantmac avatar hantmac commented on May 18, 2024

@yann0917 那次回滚的原因是我把二进制文件提交到了 Git 上,导致整个 repo 的体积太大,所以就回滚处理了一下,所以你应该 rebase 一把,不然还会把之前的大体积提交带进来

from fuckdb.

yann0917 avatar yann0917 commented on May 18, 2024

@yann0917 那次回滚的原因是我把二进制文件提交到了 Git 上,导致整个 repo 的体积太大,所以就回滚处理了一下,所以你应该 rebase 一把,不然还会把之前的大体积提交带进来

其实不是回滚,是 merge,解决的冲突

from fuckdb.

hantmac avatar hantmac commented on May 18, 2024

@yann0917 那次回滚的原因是我把二进制文件提交到了 Git 上,导致整个 repo 的体积太大,所以就回滚处理了一下,所以你应该 rebase 一把,不然还会把之前的大体积提交带进来

其实不是回滚,是 merge,解决的冲突

是的

from fuckdb.

hantmac avatar hantmac commented on May 18, 2024

已合入 develop

from fuckdb.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.