New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hope to have a 'Unix epoch to localdate' in 'Display format' selection list #1467

Closed
n-arakawa opened this Issue Jul 8, 2018 · 14 comments

Comments

Projects
None yet
6 participants
@n-arakawa
Copy link

n-arakawa commented Jul 8, 2018

Details for the issue

I hope to have a preset "Display format" for "datetime(key, 'unixepoch', 'localtime')".

When I select 'Unix epoch to date' as "Display format" and try to re-edit it,
the selection label becomes 'Custom' with text field of "datetime(key, 'unixepoch)".
However the text field is not editable.

Useful extra information

I'm opening this issue because:

  • DB4S is crashing
  • DB4S has a bug
  • [ X ] DB4S needs a feature
  • DB4S has another problem

I'm using DB4S on:

  • Windows: ( version: ___ )
  • [ X ] Linux: ( Fedora28 )
  • Mac OS: ( version: ___ )
  • Other: ___

I'm using DB4S version:

  • [ X ] 3.10.1
  • 3.10.0
  • 3.9.1
  • Other: ___

I have also:

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Jul 9, 2018

Ahhh, from rough memory I think we've adjusted the display format bit so it's editable now. That's only in the source (and nightly builds) for the moment.

Since you're on Fedora 28, would you be ok to compile this and try out our latest development code?

Compiling is pretty easy if you're familiar with general compiling practises:

https://github.com/sqlitebrowser/sqlitebrowser/blob/master/BUILDING.md#centos--fedora-linux

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Jul 9, 2018

Ahhh, I just noticed in #1466 your mention that compiling didn't work for you.

If that's still not working, would you be ok to cut-n-paste the error message bit here?

@n-arakawa

This comment has been minimized.

Copy link
Author

n-arakawa commented Jul 9, 2018

My compile error for Fedora 28

$ git rev-parse HEAD
bbe2e33ea4f1f22c85d133bdc8af20ea986eea2f
$ sudo dnf install ant-antlr antlr-C++ cmake gcc-c++ git qt-devel qt5-linguist qwt-qt5-devel sqlite-devel
Last metadata expiration check: 0:01:30 ago on Tue Jul 10 06:25:58 2018.

<SNIP>

Dependencies resolved.
Nothing to do.
Complete!
$ cmake -Wno-dev ..
-- The C compiler identification is GNU 8.1.1
-- The CXX compiler identification is GNU 8.1.1

<SNIP>

[ 44%] Building CXX object libs/qscintilla/Qt4Qt5/CMakeFiles/qscintilla2.dir/qscintilla2_autogen/mocs_compilation.cpp.o
In file included from /tmp/sqlitebrowser/fedora/libs/qscintilla/Qt4Qt5/../../../../../../../../../work2/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/ScintillaQt.h:44,
                 from /tmp/sqlitebrowser/fedora/libs/qscintilla/Qt4Qt5/qscintilla2_autogen/EWIEGA46WW/moc_ScintillaQt.cpp:9,
                 from /tmp/sqlitebrowser/fedora/libs/qscintilla/Qt4Qt5/qscintilla2_autogen/mocs_compilation.cpp:3:
/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/../include/Scintilla.h:48:19: error: expected identifier before numeric constant
 #define SCI_START 2000
                   ^~~~
/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/Qsci/qsciscintillabase.h:70:9: note: in expansion of macro 'SCI_START'
         SCI_START = 2000,
         ^~~~~~~~~
/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/../include/Scintilla.h:48:19: error: expected '}' before numeric constant
 #define SCI_START 2000
                   ^~~~
/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/Qsci/qsciscintillabase.h:70:9: note: in expansion of macro 'SCI_START'
         SCI_START = 2000,
         ^~~~~~~~~
In file included from /tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/Qsci/qscicommand.h:27,
                 from /tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/Qsci/qsciscintilla.h:32,
                 from /tmp/sqlitebrowser/fedora/libs/qscintilla/Qt4Qt5/../../../../../../../../../work2/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/Qsci/qsciabstractapis.h:29,
                 from /tmp/sqlitebrowser/fedora/libs/qscintilla/Qt4Qt5/qscintilla2_autogen/SARX73RSAP/moc_qsciabstractapis.cpp:9,
                 from /tmp/sqlitebrowser/fedora/libs/qscintilla/Qt4Qt5/qscintilla2_autogen/mocs_compilation.cpp:4:
/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/Qsci/qsciscintillabase.h:68:5: note: to match this '{'
     {
     ^
In file included from /tmp/sqlitebrowser/fedora/libs/qscintilla/Qt4Qt5/../../../../../../../../../work2/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/ScintillaQt.h:44,
                 from /tmp/sqlitebrowser/fedora/libs/qscintilla/Qt4Qt5/qscintilla2_autogen/EWIEGA46WW/moc_ScintillaQt.cpp:9,
                 from /tmp/sqlitebrowser/fedora/libs/qscintilla/Qt4Qt5/qscintilla2_autogen/mocs_compilation.cpp:3:
/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/../include/Scintilla.h:48:19: error: expected unqualified-id before numeric constant
 #define SCI_START 2000
                   ^~~~
/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/Qsci/qsciscintillabase.h:70:9: note: in expansion of macro 'SCI_START'
         SCI_START = 2000,
         ^~~~~~~~~
/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/../include/Scintilla.h:1062:22: error: expected identifier before numeric constant
 #define SC_AC_FILLUP 1
                      ^
/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/Qsci/qsciscintillabase.h:2329:3: note: in expansion of macro 'SC_AC_FILLUP'
   SC_AC_FILLUP = 1,
   ^~~~~~~~~~~~
/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/../include/Scintilla.h:1062:22: error: expected '}' before numeric constant
 #define SC_AC_FILLUP 1
                      ^
/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/Qsci/qsciscintillabase.h:2329:3: note: in expansion of macro 'SC_AC_FILLUP'
   SC_AC_FILLUP = 1,
   ^~~~~~~~~~~~
In file included from /tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/Qsci/qscicommand.h:27,
                 from /tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/Qsci/qsciscintilla.h:32,
                 from /tmp/sqlitebrowser/fedora/libs/qscintilla/Qt4Qt5/../../../../../../../../../work2/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/Qsci/qsciabstractapis.h:29,
                 from /tmp/sqlitebrowser/fedora/libs/qscintilla/Qt4Qt5/qscintilla2_autogen/SARX73RSAP/moc_qsciabstractapis.cpp:9,
                 from /tmp/sqlitebrowser/fedora/libs/qscintilla/Qt4Qt5/qscintilla2_autogen/mocs_compilation.cpp:4:
/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/Qsci/qsciscintillabase.h:2328:2: note: to match this '{'
  {
  ^
In file included from /tmp/sqlitebrowser/fedora/libs/qscintilla/Qt4Qt5/../../../../../../../../../work2/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/ScintillaQt.h:44,
                 from /tmp/sqlitebrowser/fedora/libs/qscintilla/Qt4Qt5/qscintilla2_autogen/EWIEGA46WW/moc_ScintillaQt.cpp:9,
                 from /tmp/sqlitebrowser/fedora/libs/qscintilla/Qt4Qt5/qscintilla2_autogen/mocs_compilation.cpp:3:
/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/../include/Scintilla.h:1062:22: error: expected unqualified-id before numeric constant
 #define SC_AC_FILLUP 1
                      ^
/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/Qsci/qsciscintillabase.h:2329:3: note: in expansion of macro 'SC_AC_FILLUP'
   SC_AC_FILLUP = 1,
   ^~~~~~~~~~~~
In file included from /tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/Qsci/qscicommand.h:27,
                 from /tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/Qsci/qsciscintilla.h:32,
                 from /tmp/sqlitebrowser/fedora/libs/qscintilla/Qt4Qt5/../../../../../../../../../work2/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/Qsci/qsciabstractapis.h:29,
                 from /tmp/sqlitebrowser/fedora/libs/qscintilla/Qt4Qt5/qscintilla2_autogen/SARX73RSAP/moc_qsciabstractapis.cpp:9,
                 from /tmp/sqlitebrowser/fedora/libs/qscintilla/Qt4Qt5/qscintilla2_autogen/mocs_compilation.cpp:4:
/tmp/sqlitebrowser/libs/qscintilla/Qt4Qt5/Qsci/qsciscintillabase.h:2334:2: error: expected declaration before '}' token
  };
  ^
make[2]: *** [libs/qscintilla/Qt4Qt5/CMakeFiles/qscintilla2.dir/build.make:934: libs/qscintilla/Qt4Qt5/CMakeFiles/qscintilla2.dir/qscintilla2_autogen/mocs_compilation.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:161: libs/qscintilla/Qt4Qt5/CMakeFiles/qscintilla2.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
@n-arakawa

This comment has been minimized.

Copy link
Author

n-arakawa commented Jul 9, 2018

My compile error on ubuntu 18.04

follow the BUILDING.md

$ git rev-parse HEAD
bbe2e33ea4f1f22c85d133bdc8af20ea986eea2f
$ sudo apt install build-essential git-core cmake libsqlite3-dev qt5-default qttools5-dev-tools libsqlcipher-dev
Reading package lists... Done

<SNIP>

0 upgraded, 0 newly installed, 0 to remove and 41 not upgraded.
$ cmake -Dsqlcipher=1 -Wno-dev ..
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:82 (find_package):
  By not providing "FindQt5LinguistTools.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "Qt5LinguistTools", but CMake did not find one.

  Could not find a package configuration file provided by "Qt5LinguistTools"
  with any of the following names:

    Qt5LinguistToolsConfig.cmake
    qt5linguisttools-config.cmake

  Add the installation prefix of "Qt5LinguistTools" to CMAKE_PREFIX_PATH or
  set "Qt5LinguistTools_DIR" to a directory containing one of the above
  files.  If "Qt5LinguistTools" provides a separate development package or
  SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!
See also "/tmp/sqlitebrowser/ubuntu/CMakeFiles/CMakeOutput.log".

@justinclift justinclift added the linux label Jul 9, 2018

@MKleusberg

This comment has been minimized.

Copy link
Member

MKleusberg commented Jul 12, 2018

The error you're reporting on Fedora is the one from #1361 and still unsolved. The error on Ubuntu might be easy to fix by installing the qttools5-dev-tools package. And because Ubuntu 18.04 apparently still uses cmake 3.10, you shouldn't run into #1361 there. If building with cmake still fails or if you want to build on Fedora, you can still use the qmake build by just running

cd path/to/sqlitebrowser
qmake
make

Does that help? 😄

@n-arakawa

This comment has been minimized.

Copy link
Author

n-arakawa commented Jul 12, 2018

No, 'Custom' display format is not editable with following commit on Fedora 28.

commit 5a339ea9d066aae1f5138d5e0abcef583fc7fee4
Author: Martin Kleusberg <mkleusberg@gmail.com>
Date:   Thu Jul 12 20:44:02 2018 +0200

    Fix cmake build on Windows
    
    See issue #1471.

Meanwhile, The qttools5-dev-tools package already installed but can't compile on Ubuntu 1804.

@n-arakawa

This comment has been minimized.

Copy link
Author

n-arakawa commented Jul 13, 2018

Just for compiling on ubuntu1804, apt install qttools5-dev works!

@mgrojo mgrojo added the enhancement label Sep 6, 2018

@mgrojo mgrojo self-assigned this Sep 6, 2018

mgrojo added a commit that referenced this issue Sep 6, 2018

'Unix epoch to local time' in 'Display format' selection list #1467
This adds a new display format for getting the local time (takes into
account user time zone) from a Unix time (seconds from start of 1970
in UTC).
@mgrojo

This comment has been minimized.

Copy link
Contributor

mgrojo commented Sep 6, 2018

@n-arakawa I've just added the display format that you suggested to the master branch. You can download a tomorrow's nightly build or compile from the master branch. Can you try it and report if everything is in order?

@mgrojo

This comment has been minimized.

Copy link
Contributor

mgrojo commented Sep 6, 2018

By the way, editing of display format is still not possible. We have the request #573, just in case someone wants to contribute the code.

@n-arakawa

This comment has been minimized.

Copy link
Author

n-arakawa commented Sep 7, 2018

The 'Unix epoch to local time' display format works fine!

As for "editing of display format", I hope have it to handle timestamp in milliseconds.
datetime("t"/1000, 'unixepoch', 'localtime')

Anyway, this issue has completed.
Thanks!

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Sep 8, 2018

Excellent. Good stuff all around. 😄

@justinclift justinclift closed this Sep 8, 2018

@pyrog

This comment has been minimized.

Copy link

pyrog commented Dec 5, 2018

On macOS, this display format is not yet available 😉

https://download.sqlitebrowser.org/DB.Browser.for.SQLite-3.10.1.dmg

Version 3.10.1
Qt Version 5.7.1
SQLCipher Version 3.15.2
@chrisjlocke

This comment has been minimized.

Copy link
Contributor

chrisjlocke commented Dec 5, 2018

It'll be in any version >3.10.1, eg, one of the nightlies or the current Alpha/Beta release.

@pyrog

This comment has been minimized.

Copy link

pyrog commented Dec 5, 2018

Ok, thank you 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment